antanova

MOVED: My blog is now at http://antanova.com/blog

IE7 width and min-width bug

After a day of plenty of swearing, I seem to have found something out that I think I should have known about before. I’m posting in the hope it will help out some other hapless web developer and prevent some nasty monitor-forehead interfacing.

For some reason, I know not why, after making a small change to an html page, IE7 stopped picking up some percentage widths (for floated elements). After a lot of swearing, I found out that sometimes, to even pick up a width, IE7 needs both a min-width and width. As I was using percentages that was not a hassle - so for example the rule

float:left; width: 25.5%;

was having no effect: the width of the element was shrinking down to the width of its content, while on IE6, Opera, Safari and Firefox everything was fine. Adding a min-width thus

float:left; width:25.5%; min-width:25.5%;

Sorted everything out. So now everything’s hunky dory. I’m sure most of you will have known about this and I’m quite surprised I haven’t come across it before. That’s part of the joy of the job, I suppose: after the frustration comes the satisfaction of learning something new and solving a problem.

Labels:

Jason posted this on Tuesday, January 29, 2008 at 5:29 pm. Leave comment.

Blogmarks button Digg button furl button magnolia button Google Bookmarks button StumbleUpon button Yahoo MyWeb button

Number of comments: 15

Blogger Lisa M says:

This really helped me on a website I was trying to fix. Thanks!

This comment was posted on 5:16 pm

 

Blogger Komakino says:

One other thing I discovered today about Microsoft's cursed browser is that to get it to obey min/max width properties you need to put it into strict mode by using the appropriate doctype directive at the start of your code.

< !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" >

without the spaces at the start and end, obviously.

This comment was posted on 12:51 am

 

Anonymous Anonymous says:

HELP! I’m currently being held prisoner by the Russian mafia xyzrxyz [url=http://www.buypenisenlargement.com]penis enlargement[/url] xyzrxyz and being forced to post spam comments on blogs and forum! If you don’t approve this they will kill me. xyzrxyz [url=http://www.male-sexual-styles.com]penis enlargement[/url] xyzrxyz They’re coming back now. xyzrxyz [url=http://pills.buypenisenlargement.com]vimax[/url] xyzrxyz Please send help! nitip [url=http://www.male-sexual.com/vimax-pills.html]vimax[/url]

This comment was posted on 5:21 am

 

Anonymous Anonymous says:

If some one needs expert view on the topic of blogging and site-building after that i propose him/her
to go to see this blog, Keep up the nice work.
my webpage > powiekszanie czlonka

This comment was posted on 5:29 am

 

Anonymous Anonymous says:

Payday loans online http://www.legitpaydayloansonline3.com/ Fundpopog [url=http://legitpaydayloansonline2.com/]Payday loans online[/url] Stype payday loans online Payday Loans Online Direct Lenders It's always a good idea to do your additional state loan loans, will make the total you pay larger...You can also get loan at low interest rates when a guarantor or having a form of security?

This comment was posted on 5:35 pm

 

Anonymous Anonymous says:

Do you mind if I quote a few of your articles as long as I provide credit and sources
back to your weblog? My blog site is in the very same niche as yours and my users
would certainly benefit from some of the information you present here.
Please let me know if this alright with you. Regards!


Take a look at my weblog; gracie st sugustine
Also see my site - phil cardella arrested

This comment was posted on 9:42 pm

 

Anonymous Anonymous says:

Hello there! This post could not be written any better!
Looking at this article reminds me of my previous roommate!
He always kept talking about this. I'll send this post to him. Fairly certain he will have a great read. Thanks for sharing!

my web page: careers

This comment was posted on 6:10 pm

 

Anonymous Anonymous says:

ativan pills romazicon ativan overdose - ativan yawning

This comment was posted on 12:06 am

 

Anonymous Anonymous says:

Benefits of search engine results pagesearch
engine results page tools not only helps sites with keywords in the right way.


my webpage outbacknomads.timdiekman.com

This comment was posted on 1:45 pm

 

Anonymous Anonymous says:

Wonderful blog! I found it while searching on Yahoo News.
Do you have any suggestions on how to get listed in Yahoo News?

I've been trying for a while but I never seem to get there! Appreciate it

My web site - www.teenpornsexpussy.com

This comment was posted on 6:55 am

 

Anonymous Anonymous says:

Hi there, I discovered your site by way of Google even as looking for
a related topic, your website came up, it appears to be
like good. I've bookmarked it in my google bookmarks.
Hi there, simply was aware of your blog thru Google, and located that it is truly informative. I am gonna be careful for brussels. I'll appreciate in case you proceed this in future.
A lot of other people can be benefited out of your writing.
Cheers!

my website: lower back pain right side

This comment was posted on 4:18 am

 

Anonymous Anonymous says:

Hi there! Τhіs blog post could not bе ωritten
much bettеr! Going through this article remіnds me of my previous roommate!

He alωays kept prеaching about thiѕ.
I most ceгtаіnly will send this аrtiсlе to him.
Faіrly certain he's going to have a great read. Thank you for sharing!

Feel free to surf to my website plus size clothing for women trendy *plussizeclothinghq.org*

This comment was posted on 6:34 am

 

Anonymous Anonymous says:

The first type is present from birth while the second type is
not, but starts to appear and proliferate as the years pass.
An individual can develop anywhere from 1 to well over 100 skin tags.
Females and males have the same chance of developing them.



Also visit my blog: pictures of skin tags on dogs ()

This comment was posted on 4:36 am

 

Anonymous Anonymous says:

An another alternative would be to engage a professional PPC
company that can very well combine your PPC campaign
with SEO tries to achieve a total marketing effort.
This all sound wonderful, however, what we forget is that these people have been working at
it for years. I've even talked to people who have been on a free cruise.

Feel free to surf to my web page ... how to make instant money online (Http://howtomakemoneyonlinehq.info)

This comment was posted on 2:58 am

 

Anonymous Anonymous says:

Terrific post however , I was wondering if you could write a litte more
on this subject? I'd be very thankful if you could elaborate a little bit further. Many thanks!

Take a look at my web page ... demon tools - -

This comment was posted on 4:28 am