Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IE7 & min-width

Status
Not open for further replies.

1DMF

Programmer
Jan 18, 2005
8,795
GB
maybe i'm confused, doesn't take much :)

But I though IE7 undestood min-width, is this not the case?

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!
 
IE7 definitely understands min-width; IE6 does not. If you are having problems with min-width in IE7, then make sure that you do not have width defined for the element. If you have both width and min-width defined, width will take precedence.
 
Also ensure you are using a 'real' IE7, not one of those multi-IE hacks which hasn't been configured correctly to pick up on the correct conditional comments for its version.

Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

Dan's Page [blue]@[/blue] Code Couch:
Code Couch Tech Snippets & Info:
 
no there is definately no fixed width, because it's defaulting to the width of the content.

I have
Code:
select {
    height:20px; 
    font-size:0.6em;
    float:left;
    margin:3px 0px 3px 5px;   
    min-width:100px; 
}

But get attached result?

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!
 
 http://www.homeloanpartnership.com/select.gif
i've even hard coded it as an inline style, it just will not work?

Code:
<select id="subroute" name="subroute"  style="min-width:100px;">
<option value="1"><tmpl_var name='Sub_Route'></option>
</select>

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!
 
While all the MSDN docs say it should work, it clearly doesn't.

I've tried quite a few things to get this to work, and it's not looking good.

Perhaps using width and then a JS solution like this might work?:


I did try sans-JS, using CSS :active and :focus pseudo-classes, but to no avail.

Hope this helps,
Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

Dan's Page [blue]@[/blue] Code Couch:
Code Couch Tech Snippets & Info:
 
thanks for trying Dan, not sure when it stopped working, or if it worked in the first place.

Maybe an IE7 update has broke it?

looking at the JS offering, 1stly WT? , that JQuery looks nasty, much prefer to write JS that's readable!

But it won't do what I want anyway, that code works for select lists with a fixed width which is smaller than its contents and is expanded on mouseover to be the width of the content.

I want the select list to be a min-width when the content is LESS than the width of the select list.

I think i'm just gonna hardcode a fixed width and be done with it.

Again thanks for trying.

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top