# IE fix for width:auto; (better solution?)

**URL:** <https://forum.kirupa.com/t/ie-fix-for-width-auto-better-solution/198829>\
**Category:** web dev\
**Created:** [August 28, 2006, 11:32pm UTC](https://forum.kirupa.com/t/ie-fix-for-width-auto-better-solution/198829 "2006-08-28T23:32:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![saxplayer13](https://avatars.discourse-cdn.com/v4/letter/s/ee7513/32.png) [@saxplayer13](https://forum.kirupa.com/u/saxplayer13)\
**Post date:** [August 28, 2006, 11:32pm UTC](https://forum.kirupa.com/t/ie-fix-for-width-auto-better-solution/198829/1 "2006-08-28T23:32:12Z")

</div>

So I have a division at the top of [my page](http://home.comcast.net/%7Esaxplayer13/), and it never displayed right in IE.

The most important parts:

```auto

div.top {
  position:absolute;
  right:10px;
  left:10px;
  top:10px;
  width:auto;
}

```

```auto

<div class="top">jfFlash</div>

```

So… I realized the reason my other div with (right:10px) worked was because it had more content than this one, so therefore it wrapped, and IE stretched the div to what it saw as the maximum right position, not the static right position.

Anyway, by adding

```auto

overflow:hidden;

```

and changing the code to

````auto

<div class="top">jfFlash<font color="#ffffff">I E h a s t h e w o r s t c s s i n t h e w o r l d . . . t h e s a d p a r t i s, i t i s t h e m o s t p o p u l a r b r o w s e r i n t h e w o r l d</font></div>

```html

Which is a good solution for two reasons:
1- it almost works in IE, and it did not hurt the way Firefox had correctly rendered the page, (like my attempts to set width to a percentage)
2- it makes fun of IE :lol:

But is there some way I could have solved this with CSS alone, avoiding Conditional Comments?
````
