I have the following css class:
.CtractLabel
{
font-weight:bold;
padding: 2px;
text-align:left;
/* width:120px; */
width:150px;
float:left;
border-bottom:solid 1px #aaaaaa;
border-right:solid 1px #aaaaaa;
background: white url('../Images/GridHeaderBg.gif') repeat-x bottom;
}
On my page, I have a a div with text that is less than 150px. However, the div does not expand to 150px, but contracts around the text.
Is there a way to force the div to be precisely 150px regardless of the length of the text in the div?
The default value for the width of a
divelement isauto, which causes it to take up all available space horisontally.If you don’t get this behaviour, there are some possible causes:
To see exactly what CSS applies to an element, and exactly where elements are, you can use the FireBug plugin in Firefox.