Just stuck on the Floats


#1

Hi, I am stuck here and have been adjusting my CSS text over and over in an effort to complete this section, but no go. What am I missing/doing wrong?

HTML Text













</body>

CSS Text

color{

background-color:#FAC9BE;

header{

z-index:1;
position: fixed;
border-radius:5px;
height:50px;
width:98%;
background-color:#FAF2F0;
position:fixed;

}

footer{

border-radius:5px;
height:20px;
width:98%;
background-color:#FAF2F0;

}
.left{
border-radius:5px;
height:400px;
width:20%;
background-color:#FAF2F0;
float:left;
}
.right{
border-radius:5px;
height:400px;
width:20%;
background-color;#FAF2F0;
float:right;

}


#2

Sorry my HTML did not come out! Here it is, however.













</body>


#3

html still didn't come out right, select your html code and use the preformatted text button (</>) or press ctrl + k (in both cases, make sure have the html code selected and that there is a white line below and above the code)

As for the errror, it is in your css, color (your css selector) is missing its closing curly bracket (}) which causes the error. color isn't a valid css selector, but SCT is not programmed to recognize that. If you want to set background-color for entire page, use body as css selector


#4

You. Are. A. Lifesaver! You know, I couldn't see any of my divs, but I bet you already knew that! :wink: Now I can see them and have a look at what needs to be fixed, instead of guessing. Pretty awesome, thank you!


#5

You're welcome jbrownbear


#6

Hi,

I got a trouble with Floating left and right - i cannot finish this exercise. Could you give me an advice, what is wrong with my code?

Thanks a lot.

Dana


stylesheet.css

header{

border: 2px solid black;
border-radius:5px;
position:fixed;
z-index:1;

}
.left{
float:left;
}
.right{
float:right;
}
#footer
{
height:50px;
width:50px;
background-color:green;
}
div
{
color:blue;
border:2px solid;
}


#7

simple answer: remove class left from your #header (first div)

long answer:

If you are planning on using an id and class on a single element, that is fine, but at least put a space between it:

<div id="header" class="left">

However, i do not recommend this at this moment, float doesn't work on fixed elements. (fixed elements -> elements with position: fixed)


#8

It is working!

Thanks a lot for quickly answer!

Have a nice day.


#9











</body>

Oops, try again. Did you remember to float .left to the left?
what is the problem in my code?


#10

if you edit/update your question, leave a reply so i get a notification. Your code is not visible, take the following steps to make it visible: