Reputation: 3085
I have this div in my code:
<div id="advice" class="validation-advice" style="">some text here</div>
Now, can I use a selector or something to say that all divs with the class validation-advice should only have a width of lets say 100px?
I tried:
div.validation-advice{
width:100px;
}
Strange thing is, the div width changes (I used Firebug to see) but the text inside the div does not wrap when the div ends. Whats missing?
Thanks!
Upvotes: 0
Views: 95
Reputation: 575
probably your divs have display:inline, try this:
div.validation-advice{
display: block;
width:100px;
}
Upvotes: 0
Reputation: 5681
div.validation-advice{
width:100px;
}
The problem that your text not wraps at the end of the div is because you just enter plain text. If you do it like this you have no problems:
<div class="validation-advice">
<p>Your text here</p>
</div>
Upvotes: 1