Css Width Property Not Respected
I am adding some formatted div tags to a site with virtuemart in Joomla. I have had success so far in this. I modified the template we are using to include a css file 'article.css'
Solution 1:
What I see from your posted code is that you are using width
property on an inline element.
10.2 Content width: the 'width' property
This property does not apply to non-replaced inline elements. The content width of a non-replaced inline element's boxes is that of the rendered content within them (before any relative offset of children).
width
/height
properties are not applicable to non-replaced inline elements. If you want to keep div.Property_Name
inline, you need to use inline-block
as the value of display
property.
div.Property_Name {
display: inline-block; /* <-- Change the display type */margin-right: 10px;
color: #C41163;
width: 240px;
}
Solution 2:
Inline elements do not respect a width declaration by nature. Try using inline-block
Post a Comment for "Css Width Property Not Respected"