in fixed width layout should i define width to element inside wrapper again like for header, footer, banner etc?
In fixed width layout if width of layout is already defined in #wr开发者_运维知识库apper {width:970px}
then
what should i add to inner div which i want to expand fully .like for header, footer, banner etc
- same
width:970px
to all div also - No need to define any width
- or
width:100%
should be added
Either 2 or 3..
Hardcoding the same value more than once (case 1) will only lead to trouble and more work whenever you decide to change the size of the wrapper..
And from 2 and 3, better use 2 ( as @Pablo mentioned)
- because it is greedy and will expand to its parent width.
- because you can add additional properties like border/padding/etc that affect its size, without having to make manual adjustments..
I think the correct answer is number 2.
divs
by default take as much horizontal space as they can.
Anyways you might fine more detailed answers in http://doctype.com (like SO but design oriented).
Regards!
Edit: There's an interesting discussion about this topic here
精彩评论