html - CSS to constrain 960px inside a div? -
html - CSS to constrain 960px inside a div? -
at moment have (standard) code gives me full-width background constrains header centered 960px:
<div style="background-color: #222"> <header style="width: 960px; margin: 0 auto;"> <h1>site title</h1> </header> </div>
is there way can apply single element in css, , avoid div
altogether? considered this jquery hack calculate , set left , right padding on header
pure css solution better.
desired html:
<header> <h1>site title</h1> </header>
it might not possible thought i'd inquire before dismissing it!
you can ditch div wrapper in favor of :before
, :after
. here's article on it: http://css-tricks.com/9443-full-browser-width-bars/
the end of article has link info on browsers back upwards :before
, :after
. don't, utilize javascript polyfill.
html css
Comments
Post a Comment