I have a <div>
which needs to be auto adjusted according to the content in it. How can I do this? Right now my content is coming out of the <div>
The class I have used for the div is as follows
box-centerside { background:url("../images/greybox-center-bg1.jpg") repeat-x scroll center top transparent; float:left; height:100px; width:260px; }
The content height of a div can dynamically set or change using height(), innerHeight(), and outerHeight() methods depending upon the user requirement.
If height: auto; the element will automatically adjust its height to allow its content to be displayed correctly. If height is set to a numeric value (like pixels, (r)em, percentages) then if the content does not fit within the specified height, it will overflow.
The css rule: white-space: nowrap; will prevent your lines wrapping. Set a width of the error div to 100% and it will automatically fill the space available.
Just write "min-height: XXX;" And "overflow: hidden;" & you will be out of this problem Like this
min-height: 100px; overflow: hidden;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With