Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Doctype and CSS

Tags:

html

css

doctype

I have following code with doctype transitional but when I set it to strict then the position of images get changed and moves upward. Could you please help me in understanding the underlying issue and where I can find list of these type of other CSS conflicts between different doctypes.

Please note that I know that few HTML tags are not available in strict mode but I am specific about CSS conflicts.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<body>
<style type="text/css">
span.check:before { content: url("http://i41.tinypic.com/2rxea7d.png"); }
</style>
<table> 
<tr>
<th>Ruby on Rails</th>
    <td><span class="check"></span></td>
    <td><span class="check"></span></td>
    <td><span class="check"></span></td>
    <td><span class="check"></span></td>
</tr>
<tr>
<th>Road on Rails</th>
    <td><span class="check"></span></td>
    <td><span class="check"></span></td>
    <td><span class="check"></span></td>
    <td><span class="check"></span></td>
</tr>
</table>
</body>
</html>
like image 232
Shawn Taylor Avatar asked Oct 08 '22 21:10

Shawn Taylor


1 Answers

In quirks mode and almost standards mode the images (which are inline content, so are laid out on the same set of lines as font characters) are zero-height positioned at their baseline.

You can get the same effect in Standards mode by twiddling the vertical-align property of your generated images or setting them as display: block.

like image 119
Quentin Avatar answered Oct 13 '22 12:10

Quentin