tags:

views:

418

answers:

1

I'm trying to use a negative top margin on a element and it is not working in Firefox. Chrome and IE (using HTML5-shiv) are rendering it properly. I have given the HTML5 elements (including a display: block).

Thoughts? CSS if you need it:

aside, article, section { display: block; }


section#banner {
background: url(images/banner.png) no-repeat 3px 3px;
border: #CCD1DB 1px solid;
-moz-border-radius: 10px; /* FF1+ */
-webkit-border-radius: 10px; /* Saf3+, Chrome */
border-radius: 10px; /* Opera 10.5, IE 9 */
-moz-box-shadow: 0px 0px 4px #E0E3E9; /* FF3.5+ */
-webkit-box-shadow: 0px 0px 4px #E0E3E9; /* Saf3.0+, Chrome */
box-shadow: 0px 0px 4px #E0E3E9; /* Opera 10.5, IE 9.0 */
display: block;
height: 350px;
margin: -50px auto 0;
overflow: hidden;
padding: 3px;
position: relative;
width: 600px;
}
A: 

http://dev.w3.org/html5/spec/Overview.html#the-section-element

The section element is not a generic container element. When an element is needed for styling purposes or as a convenience for scripting, authors are encouraged to use the div element instead. A general rule is that the section element is appropriate only if the element's contents would be listed explicitly in the document's outline.

More resources: http://html5doctor.com/the-section-element/

rebus
thanks. kind of ridiculous, imo...but i appreciate the reference.
CoryDorning
This doesn't mean you can't, just that you shouldn't.
rebus
unfortunately, changing it to a <div> didn't fix the issue. :(
CoryDorning
Hmm, it seems to work ok in my FF (3.6.3)...
rebus
CSS is sometimes tricky to debug, there could be other styles applied to `#banner` element that together cause this behaviour. Try checking with Firebug https://addons.mozilla.org/en-US/firefox/addon/1843/
rebus
Yeah, I've checked with firebug and it shows that the negative margin exists, but the content isn't moving up.
CoryDorning