<tr>-margin mysteriously added when using <!DOCTYPE HTML>
When I specify a doctype, my menu 开发者_Python百科button table row suddenly gets a margin - 4 pixels above and 3 below.
Have a look: http://twineboard.se/pete/index.php
I added doctype only to the first page. Navigate to other pages to see the table beautifully collapsed as should be.
What could be the problem?
If you aren't using a doctype, then you are in 'quirks mode', and the box model for web pages is like it's 1995 all over again. The modern web requires a doctype and no pages should be created without one.
First of all, tables are an awful way to design a layout like that. Second of all, the DOCTYPE
tells the browser how to render the HTML, it's very important for all pages. Thirdly if you want to fix that issue, try using a CSS Reset
or setting global properties of padding:0px; margin:0px;
精彩评论