views:

117

answers:

1

I used some div and ul to display some items in list as shown bellow. In Firefox and chrome all the links works fine. But in IE link 'All Items' and link 'Information' does not work.I have found some clues like due to 'margin-left' property it is occurring.If I remove 'margin-left' from that specific anchor link it works, but alignment is distorted.Can anyone help me how to solve this.

    <div style="float: left; width: 8%; margin-left:112px;">
            <ul style="list-style-type: none; text-align: left; font-weight: 900;">
                <li><a href="a.aspx" >Item1</a></li>
                <li><a href="b.aspx" >Item2</a></li>                    
                <li><a href="c.aspx" >Item3</a></li>
                <li><a href="d.aspx" >Item4</a></li>
            </ul>
           </div>
            <div style="float: left; width: 11%; margin-left: 0px;">
            <a href="h.aspx" style="margin-left: -35px; font-weight: 900;">All Items</a>                  
            <ul style="list-style-type: none; text-align: left; margin-top: 3pt;">  
            <li><a href="e.aspx" >Item No1</a></li>
            <li><a href="f.aspx" >Item No2</a></li>
            <li><a href="g.aspx" >Item No3</a></li>
            </ul>
            </div>
            <div style="float: left; width: 15%; margin-left: -25px;">
            <a href="i.aspx" style="margin-left: -25px; font-weight: 900;">Products</a>                  
            <ul style="list-style-type: none; text-align: left; margin-top: 3pt;">  
            <li><a href="j.aspx" >Product1</a></li>
            <li><a href="k.aspx" >Product2</a></li>
            <li><a href="l.aspx" >Product3</a></li>
            </ul>
            </div>
            <div style="float: left; width: 12%; margin-left: -9px;">
            <a href="l.aspx" style="margin-left: -7px; font-weight: 900;">Categories</a>                  
            <ul style="list-style-type: none; text-align: left; margin-top: 3pt;">  
            <li><a href="m.aspx" >Category1</a></li>
            <li><a href="n.aspx" >Category2</a></li>
            <li><a href="o.aspx" >Category3</a></li>
            </ul>
            </div>
            <div style="float: left; width: 11%; margin-left: -14px;">
            <a href="p.aspx" style="margin-left: 25px; font-weight: 900;">Information</a>                  
            <ul style="list-style-type: none; text-align: left; margin-top: 3pt;">  
            <li><a href="q.aspx" >Information1</a></li>
            <li><a href="r.aspx" >Information2</a></li>
            <li><a href="s.aspx" >Information3</a></li>
            </ul>
            </div>
        </div>
A: 

I think the problem is that the a tag doesn't have a non-blank href or name:

<a class="aa" href="" style="margin-left: 25px; font-weight: 900;">Informations</a>

I thought that that was actually invalid, but the validator doesn't say it is. Still, though, I'd use href="#" or something.

T.J. Crowder
href="#" will refer to the page you're already visiting, so yes using your method will work.
Jordy
-1, An empty `href` attribute is perfectly fine and valid and wouldn't stop a link from working, especially since *all* links had empty `href` attributes, but only two of them aren't working.
mercator