Limit on Div height?

liunx

Guest
I have noticed that my Div's minimum height is about 10-15 pix. What should I do to make it thiner (less pixels heigh)? Since in this particular case the Div I use is just filled with color, for the purpose of decoration, perhaps I can use the code for CSS line instead?!

-jms<div style="width:100px"></div> <!-- nothing here -->
<div style="width:100px;border-bottom:1px solid red;margin:10px 0;"></div>
<div style="width:100px;border-bottom:3px solid red;"></div>Your code works, but my doesn't. What's wrong with mine? The div remains about 10-15 pix wide and doesn't get any thinner. Thanks.


position:absolute;
visibility: visible;
left: 0px;
top: 386px;
width: 1024px;
border-bottom: 4px;
background-color: #666666;Do you have a space or carriage return in your div? If so that might be affecting the height.<div id="Layer18"><p class="test"></p></div>



p.test {
position:absolute;
visibility: visible;
left: 0px;
top: 386px;
width: 1024px;
border-bottom: 4px;
background-color: #666666;
}Try this kludge in your CSS for the div: line-height: 1px;By using background IE assumes content and sets the height according to font-size. Solution set font-size:0;
In Moz. you see nothing. No height is set, default is zero. Solution set height:4px;

The simple solution; use colored borders!The p tag automatically adds height both above and below the tag. You might want to set the padding to a specific value like

padding:2px 0 2px 0;

That would give it a total of 4px in height.I tried the several different postings but couldn't get it to work. This is what works though:

p.test {
position:absolute;
visibility: visible;
left: 0px;
top: 368px;
width: 1024px;
style width: 1024px;
display: inline;
border-bottom: 8px solid #000;
border-color: #666666;
}

And in the HTML page:

<div id="Layer18"><p class="test"></p></div>


If you can make this work in a different way, please poste the whole code. Thanks.p.test {
position:absolute;
top: 368px;
width: 1024px;
border-bottom: 8px solid #666;
}


btw such a width will produce a scrollbar on a majority of monitors
 
Back
Top