Results 1 to 5 of 5
Thread: ie6 max width set in percent
Jul 4, 2007, 07:02 #1
ie6 max width set in percent
I have googled and looked in forums, as well as searching the sitepoint forums, and can't find a suitable answer.
What is the best way to set the maximum width of a div as a percentage of the parent div in ie6?
I am using a 3 column liquid layout based on the example in the Sitepoint book HTML Utopia: Designing Without Tables.
For those of you familiar with it, I want 2 divs inside the content.inner, one 30% of the container.
Jul 4, 2007, 14:42 #2
- Join Date
- May 2006
- Aurora, Illinois
- 0 Post(s)
- 0 Thread(s)
IE 6 doesn't understand min/max-width, so you're going to have to resort to an expression or filter for this. This should be in the CSS FAQ though.
http://www.svendtofte.com/code/max_width_in_ie/Save the Internet - Use Opera | May my mother rest in peace: 1943-2009
Dan Schulz - Design Team Advisor | Follow me on Twitter
WordPress SEO Checklist | What WordPress Plugins Do You Use?
Web Standards Curriculum | Image Free Equal Height Columns
Jul 5, 2007, 11:15 #3
I don't mind using an expression filter, I just can't find one that deals in percent of the containing div.
I already read that page you linked to Dan. If I'm reading it right, it sets the width of an element depending on the size of the viewport. Also, it depends a lot on the font-size being used.
I want a box to be 30% of the width of the box it's in.
Jul 9, 2007, 16:43 #4
<div id='container'> <div style="width: expression(this.width > document.getElementById('container').offsetWidth /3 ? (document.getElementById('container').offsetWidth /3 +1) + 'px' : 'auto');"></div> </div>
Hope that helps!
Jul 12, 2007, 07:46 #5
I'll give that a try. Thanks very much.