Need an IE7 hack

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

Hi. My site ( is having some issues in ie7. The problem is
that the content in the right sidebar <div id="sidebar"> is not
rendering correctly. Specifically the lists. Essentially, the lists are
overlapping the content to the left.

For ie7, is the following the best solution:

<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="iestyles.css" />

and then create a seperate CSS file just for ie7.


Re: Need an IE7 hack wrote:

Quoted text here. Click to load it

Fix the broken code first.  You're serving XHTML 1.0 Trans as
text/html, and you're doing it badly. It's invalid code with numerous
glitches, in particular the <?xml ?> prolog. Chances are that this puts
the browser into a quirks mode. Get it valid, and get it into a
standards mode first.

Quoted text here. Click to load it

Check that you set all 8 values of margin and padding when working with
lists. Default stylesheets for them vary between browsers. You might
adjust margin on one when actually the next browser controls it with

Quoted text here. Click to load it

No. Whatever it is, anything that begins "for <browsername>" is never a
good solution on the web.

Quoted text here. Click to load it

If you absolutely _MUST_ (and I only know one minor reason why), then
use this to create a _supplemental_ stylesheet for IE, sufficient to
contain the minimal fixes needed.

Re: Need an IE7 hack

Hi Andy,

Thanks for the advice about the lists. I will give it a shot. As you
can see I haven't set all of the 8 values for my lists:


#wrap > #sidebar ul{
    margin: 0 -23px;
    #sidebar ul {
        margin: 0 15px;
    #sidebar ul li {

    #sidebar ul#linkslist {
        margin: 0px;
    #wrap > #sidebar ul#linkslist{
    margin: 0 -38px;


<h2>Recent Posts</h2>

                    <?php wp_get_archives('type=postbypost&limit=10');

<h2><?php _e('Categories'); ?></h2>

             <?php list_cats(0, '', 'name', 'asc', '', 1, 0, 1, 1, 1, 1,
0,'','','','','') ?>

    <ul id="linkslist">
                <?php get_links_list('_id'); ?>

                <br />

   <div id="flickr">
                       <li><?php get_flickrrss(); ?></li>

<h2><?php _e('Archives'); ?></h2>

            <?php wp_get_archives('type=monthly'); ?>


What concerns me, though, is what you wrote in the first paragraph. I'm
obviously a novice web design designer and was unaware that the code
was invalid. Needless to say, I would like to fix this immediately. Is
there a website you (or anyone) could recommend on such topics?
Specifically what you mentioned in the first paragraph:

Quoted text here. Click to load it

Thanks again

Site Timeline