The achcor (display:block) brings extra space in IE7?
Hi, I am using html5 so i guess i am able to put <div> inside the <a> (display: block). But when the <div> has float: left, it always brings extra space between <a> in IE7. Other browser works quite fine. Does anyone know any reason or solution? Thanks a lot!!
If you view the code from browser, you will be able to to see there is a gap between 'second' and 'third'. By removing the 'float: left' from 'second', the gap will be gone.
Thanks a lot, everyone!
Last edited by Kor; 04-06-2011 at 04:03 AM.
Reason: wrap the code [code][/code]
Block elements (DIV) can not be nested within inline elements (A). The fact that you gave a display block to the anchor does not change its native display type, which remains inline.
You should modify the structure of the HTML according to this principle.
Block elements (DIV) can not be nested within inline elements (A). The fact that you gave a display block to the anchor does not change its native display type, which remains inline.
You should modify the structure of the HTML according to this principle.
I heard that in HTML5 the <div> can be nested in <a>. I validated my html code, and it seems it is valid.
Bookmarks