Hi folks,
I am playing around with css, and I want to control the font of text in a table. The html code is:
and style.cssCode:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>Table with DIV and CSS</title> <link rel="stylesheet" href="style.css" type="text/css" /> </head> <body> <div class="leftnav"> <div id="main"> <a href="localhost"> <div class="element"> <img class="divright" src="a.jpg" alt="intro_thumnail" /> <p> <span class="text1" >test1</span><br /> <span class="text2" >test2</span> </p> </div> </a><a href="localhost"> <div class="element"> <img src="b.jpg" class="divright" width="50" height="50" alt="intro_thumnail" /> <p>test3, test 4 test 5</p> </div></a> </div> </div> </body> </html>
My question is about test1 and test2 (I put the red and white background for easily see the problem). In FF I see no gap or extra space between those to white spans, but in IE, there is a red space between them. Why is that? How can I eliminate that space?Code:.leftnav { float: left; width: 400px; } .content { margin-left: 400px; } .rightnav { float: right; width: 300px; } #main { background-color: #ffffff; border: 2px solid blue; margin: 0 0 0 0; width:60%; } .element { background-color: red; border: 2px solid blue; margin: 0 0 0 0; float: left; width:99%; } .element:hover { background-color: green; } div.element p { margin-top: 0; } .divright { float: left; width: 100px; margin: 0 0 0 0px; background-color: #ddd; padding: 2px; border: 1px solid blue; width:100px; } span.text1 { font: 15px arial; background-color: white; margin-bottom:20px; padding: 0px; width:100%; } span.text2 { font: 8px arial; background-color: white; margin: 0 0 0 0; padding: 0px; }
Thanhks,
D.



Reply With Quote



Bookmarks