|
| |
|
|
Nicole
Posts: 2959 Joined: 9/15/2004 From: Sydney, Australia Status: offline
|
Divs not lining up - 5/4/2009 6:33:02
I'm very slowly redesigning a clients existing site from a tables layout to a CSS layout. The opening page will look similar to this, only I've decided that the text at the top of the page looks better in a div with another colour background and placed above the column labeled "Latest News" so the div configuration should look like this. The thing is, when I add content to the sidebar the div called "bbb" drops down to be in line with div "ccc" like this. I've no idea why it's doing this and it's taken me all afternoon to discover what was actually making it drop like that. Wondering whether some of the content was somehow too wide, I've changed the width of everything in the sidebar div, but div "ddd" is still dropping. I'm at a loss and it's now driving me spare. Does anyone else have any ideas?
_____________________________
". . . and God created man in his image." errr, shouldn't that be "and man created God in his image'?
|
|
|
|
Nicole
Posts: 2959 Joined: 9/15/2004 From: Sydney, Australia Status: offline
|
RE: Divs not lining up - 5/4/2009 19:35:14
Thank you Tail! I may not have ever discovered that, or at least not for a long while as usually when things go wrong I delete things (or add them) one at a time. I'm not sure I'd found this as they were both to do with the margin. I was going to change every px measurement in the css file to an em measurement. Is this considered better these days still or not?
_____________________________
". . . and God created man in his image." errr, shouldn't that be "and man created God in his image'?
|
|
|
|
Nicole
Posts: 2959 Joined: 9/15/2004 From: Sydney, Australia Status: offline
|
RE: Divs not lining up - 5/5/2009 18:43:15
Thanks Dave, I'll take a look at that link. I always thought 1em=16px? Tail, thanks also. I didn't know there was something such as max-width. Makes sense as screens are getting bigger and wider.
_____________________________
". . . and God created man in his image." errr, shouldn't that be "and man created God in his image'?
|
|
|
|
d a v e
Posts: 4348 Joined: 7/24/2002 From: England (but live in Finland now) Status: online
|
RE: Divs not lining up - 5/5/2009 23:06:16
"The 62.5% trick In May of 2004, Richard Rutter wrote a seminal piece in web typography in which he outlined a trick that helps make this math easier. Because typical browsers default their text size to 16px, one can set the font-size value of the body element to 62.5%, effectively resetting the default to 10px. From there, Rutter suggests using ems for font-size, which acts as a scaling factor. This makes for simpler math: 15 pixels is 1.5em. 18 pixels is 1.8em. Nine pixels is 0.9em. And so forth. However, this only remains this simple if no inheritance is involved. As in our paragraph-inside-a-list-item example before, things still get complicated when items with different font-size values are nested."
_____________________________
David Prescott Gekko web design
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|