I need to show a text with horizontal rule almost touching the text. that is the vertical height between the text and hr should be very less. This should be displayable in mobile safari browser.
+1
A:
I would set the margin and padding of the HR element to zero.
hr {
margin:0;
padding:0;
}
George Mandis
2010-10-07 21:14:19
A:
Set the padding/margin to 0 of your hr: (note i put the HR inside the because you don't want all HR's assuming that style. You could also give the < hr/> it's own CSS class too.
<html>
<head>
<style type="text/css">
body {color:red;}
h1 {color:#00ff00;}
p.ex {color:rgb(0,0,255);}
.new{vertical-align:text-bottom;}
.new hr{padding:0;margin:0;}
</style>
</head>
<body>
<div class="new">
test text
<hr/>
<div>
</body>
</html>
Ryan Ternier
2010-10-07 21:15:02