CSS Style center

CSS Styles, CSS tips

Portfolio

IE 7 ul in floating div

Hi guys,

Recently i have encountered a problem in IE7 when i put a ul in a floating div, for some reason the ul slides out of the div and it doesn’t look good at all.

The Solution for the ul in floating div:

Just add in your header a new stylesheet witch will load with IE 7 like this:

<!–[if IE 7]>
<link rel=”stylesheet” href=”css/ie7style.css” media=”screen”>
<![endif]–>
This way when ie7 loads the page it loads this stylesheet along and all you need to do is add the needed css rules to fix this problem without changing the look in the other browsers.
If some of your styles are written inline and you need to override it all you have to do is add within your new specific style the expression !important like this
#floatingDiv {margin:10px 0 15px 5px !important;}
When you will add this code to your newly created css, it will effect the specific element only in IE7
Thank you for reading this post, and feel free to post comments.

3 Responses to IE 7 ul in floating div

Samantha says: April 5, 2010 at 8:13 pm

thanks for posting the solution for the ul in floating div– i encountered the same problem too and i found this site ! thanks!

Tim says: May 18, 2010 at 9:27 am

I’ve got a floating div with a list in it, but I think I’ve run into a fairly unique issue with IE, or so it would seem.

I’m trying to debug the list for IE7 using the Developer Tool in IE8. The page is rendered in IE7 standards mode, but the developer tool is seeing my closing tag as being written .

I’ve never seen this happen, and it certainly isn’t happening in other browsers. But in IE7 it’s definitely jacked. Even in IE8 everything is fine.

Ever run into anything like this?

-Tim

leonzinger says: May 25, 2010 at 12:42 pm

Hey Tim,

Thanks for your comment.

Can you give me the url of your website so i will check it out?

Leon

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>