Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS

Hey everyone, i got a problem, i tried fix that a few days but i can't do that.

http://i.imgur.com/OcAjYMr.png here is pic for my problem.

Second white block should be same level with first white block. When is no text in the first white block, everything seems fine. but when there is a text, all fragmented.

my css code and html:

/* footeris */
footer {
float: right;
padding-top: 20px;
padding-right: 355px;
}

/* footerio tekstas */
footer p {
 font-size: 10px;
color: #fff;
}

/* Body backgroundas */
body {
 background: #937457;
}

/* Body centravimas */
body {
max-width: 1000%;

}

/* Headerio logotipas */
#logotipas {
 width:1200px;
 height:300px;
background: url("http://www.listofimages.com/wp-content/uploads/2013/07/coffee-owl-coffee-beans-coffee-cup-creative.jpg") no-repeat fixed center;
 border-style: solid;
 border-color: #7A6149;
 margin: 10px auto;
}

/* logotipo tekstas */
h1 {
 color: #fff;
 padding: 60px 0px 0px 45px;
 text-shadow: 2px 2px #000;
}

/* Logotipo subtektas */
h2 {
 font-size: 12px;
 margin-top: -20px;
 padding: 0 45px;
}

/* Panele */
#panele {
 width: 300px;
 height: 300px;
 background: #fff;
 margin-left: 358px;
 border-radius: 20px;
}

/* Naujienos */
#naujienos {
 width: 875px;
 height: 300px;
 background: #fff;
 margin-left: 330px;
}

html :

<!DOCTYPE html>
<html>
 <head>
  <meta charset="utf-8">
  <title>Kavos tema</title>
  <link rel="stylesheet" href="normalizatorius/normalize.css">
  <link rel="stylesheet" href="stilius/stilius.css">
 </head>
 <body>
  <header id="logotipas">
   <h1>Pūpelių kava</h1>
   <h2>Skaniausia kava mūsų žemėje.</h2>
  </header>
  <div id="panele">
  <span>tekstas</span>
  <div id="naujienos">
  </div>
  </div>
  <footer>
  <p>Visas kodas rašomas/nekopijuojamas - Airidas Žalkauskas</p>
  </footer>
 </body>
</html>
Colin Marshall
Colin Marshall
32,861 Points

Hi Airidas Zalkauskas,

Please see the link on the right titled "Tips for asking questions" which will give you instructions on how to properly post code on the forum so it displays as code. You can just edit your original post to fix it. Thanks!

Colin Marshall
Colin Marshall
32,861 Points

Also, please be more specific about your problem. I see the screenshot you posted but I am unsure of what it should look like.

Second white block should be same level with first white block. When is no text in the first white block, everything seems fine. but when there is a text, all fragmented.

1 Answer

Greg Kaleka
Greg Kaleka
39,021 Points

Looks good! Airidas, I'd also suggest adding padding to the #panele div if you're going to include text.

padding: 10px;

Seemed to work well as a minimum.