I'm a CSS newbie. It's really awesome - there are so many things you can do with it! Anyway, I am teaching myself and to practice I am trying to create a tableless page. I have a div called "content". It is positioned 70px from the top and 170px from the left. I want the div to fill in to 10px within the right margin (whatever that may be for the user's window size). As you can see I have set the width to 100%. But 100% goes off the screen to the right. I don't want to make a fixed width. I just want it to fill in. Any ideas are much appreciated.
#content {
left : 170px;
top : 70px;
position : absolute;
color : #000000;
background-color : #FFFFFF;
border : 1px solid #666666;
width : 100%;
}
By the way, what is the difference between div and span?
Question
Guest jl7c2
Hello,
I'm a CSS newbie. It's really awesome - there are so many things you can do with it! Anyway, I am teaching myself and to practice I am trying to create a tableless page. I have a div called "content". It is positioned 70px from the top and 170px from the left. I want the div to fill in to 10px within the right margin (whatever that may be for the user's window size). As you can see I have set the width to 100%. But 100% goes off the screen to the right. I don't want to make a fixed width. I just want it to fill in. Any ideas are much appreciated.
#content { left : 170px; top : 70px; position : absolute; color : #000000; background-color : #FFFFFF; border : 1px solid #666666; width : 100%; }By the way, what is the difference between div and span?
Thanks!
Link to comment
Share on other sites
5 answers to this question
Recommended Posts