Hello,
I would like to set the width of an html element to be 100% of the width of its contents. This will mean that it will be bigger than its parent element.
Here is the html:
And the CSS:Code:<div id="items"> <ul> <li><img src="sample.png"></li> <li><img src="image.jpg"></li> ... </ul> </div>
Can I do this with CSS, or do I have to use Javascript/jQuery?Code:#items{ width: 100%; //full browser window overflow: hidden; } #items ul li{ list-style-type: none; float: left; margin-right: 20px; } #items ul{ //I want the width of this element to be the full width of all of the images in the list, no matter how wide the parent element is. Right now the images wrap to a new line. }
Thanks for your help!
Devon


LinkBack URL
About LinkBacks
Reply With Quote
icon below! (this is even better than "liking" a post)

