Why does this page's elements not center when a width is defined? I am sure I am missing some small detail. Images are just placeholders. Thanks for any help.
Why does this page's elements not center when a width is defined? I am sure I am missing some small detail. Images are just placeholders. Thanks for any help.
that should center the bodyCode:* { margin: 0 auto; }
The inline content is centered; it's centered relative to its left and right sides, which depend on the parent element. By setting a width on <body>, you've restricted the left and right sides of its descendants. If you center the body (e.g. by setting margin to "auto" for modern browsers), everything centered within <body> will be appear centered relative to the viewport.
Be sure to read all pages linked in this post; they have further information that should prove useful. When asking for help, make sure you follow Eric Raymond's and Jon Skeet's guidelines for prompt, accurate responses. Please answer any questions I ask; they're not rhetorical (probably). Any posted code is intended as illustrative example, rather than a solution to your problem to be copied without alteration. Study it to learn how to write your own solution.Misson, not Mission.
Thanks misson, that did the trick =]
Don't count out Diablo's suggestion. It will center block elements with explicit widths, whereas using text-align won't.
The #menu definition list as used is non-semantic. An <ul> or <ol> would be better.
Be sure to read all pages linked in this post; they have further information that should prove useful. When asking for help, make sure you follow Eric Raymond's and Jon Skeet's guidelines for prompt, accurate responses. Please answer any questions I ask; they're not rhetorical (probably). Any posted code is intended as illustrative example, rather than a solution to your problem to be copied without alteration. Study it to learn how to write your own solution.Misson, not Mission.
Well yes, but I plan to use the different elements in the definition list to distinguish between menu and sub menu items.
Are you implementing an accordion menu?
Be sure to read all pages linked in this post; they have further information that should prove useful. When asking for help, make sure you follow Eric Raymond's and Jon Skeet's guidelines for prompt, accurate responses. Please answer any questions I ask; they're not rhetorical (probably). Any posted code is intended as illustrative example, rather than a solution to your problem to be copied without alteration. Study it to learn how to write your own solution.Misson, not Mission.
No, just a difference in style. It is like a drop down menu, except already dropped down.
Code:dl dt { font-size: 100px; color: pink } dl dd { font-size: 9px; color: black }
Last edited by Twinkie; 09-22-2009 at 06:35 AM.
Looks like list abuse; <dt> denotes a term and <dd> it's definition. Any other use is non-semantic and means programs (such as search engine spiders) can't deduce as much information, or will deduce the wrong information. Better to use an unordered list and a class for whichever list items are the exceptions.
Also, using "px" for font sizes doesn't scale well with monitor resolution.
Be sure to read all pages linked in this post; they have further information that should prove useful. When asking for help, make sure you follow Eric Raymond's and Jon Skeet's guidelines for prompt, accurate responses. Please answer any questions I ask; they're not rhetorical (probably). Any posted code is intended as illustrative example, rather than a solution to your problem to be copied without alteration. Study it to learn how to write your own solution.Misson, not Mission.