The issue i'm having is that if i change the padding of children elements.. those elements spill out of the parent. is there a way to make the parent adjust it's dimensions?
thanks for the help!
| SitePoint Sponsor |
The issue i'm having is that if i change the padding of children elements.. those elements spill out of the parent. is there a way to make the parent adjust it's dimensions?
thanks for the help!





Hello
without any code it's a guess use float ?
Code:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>12345 12345 12345 12345 12345</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <!-- saved from url=(0022)http://www.domain.com/ --> <style type="text/css"> .a{ background:#ffffcc; float:left; } .b{ width:20em; padding:1em; margin:2em; background:#ccffcc; } </style> <script type="text/javascript"> </script> </head> <body> <div class="a"> <div class="b">some text</div> </div> </body> </html>
it's something like this
what's happening is that the container div's height, is the height of the text.. it's not adjusting for the padding that is on the child span elementPHP Code:<div id="container">
<span style="padding:20px;">some text</span>
</div>





Hello
a span is inline , try it with padding 20px on the container also, or make the span display:block;
all4nerds, thanks for the help,
i don't want/need padding on the container and making the spans block wont work because i have more than one span in that container div and they need to be inline..
Bookmarks