简体   繁体   中英

Why Won't My CSS Pull Down Menu Show in Internet Explorer?

I thought I remembered testing my menu in IE, but now it doesn't work. :( It works perfectly in Chrome and FireFox. I tried looking at the other answers, but couldn't find an answer that fit mine.

You can check My Website here

Thank you in advance! I'm new to CSS and this was definitely a struggle for me. I thought I conquered this already and now I'm just trying not to cry. :(

You have <font> tag in twice in between your <ul> and <li> elements.

http://validator.w3.org/check?uri=www.compray.com&charset=%28detect+automatically%29&doctype=Inline&group=0

Remove them and it will render properly.

Edit:

If you want different font sizes have you tried:

 <ul id="mainmenu">
    <li><a href="">Home</a>
        <ul>
            <li><a href="">item 1</a></li>
            <li><a href="">item 2</a></li>
            <li><a href="">item 3</a></li>
        </ul>
    </li>
    <li><a href="">FAQ</a></li>
    <li><a href="">Products</a></li>
    <li><a href="">Service</a></li>
    <li><a href="">Contact Us</a></li>
</ul>


#mainmenu li { //font styles }
#mainmenu ul li { //font styles }  

Also, this is why it is not working, you are missing the dtd:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

Your document is not valid. First thing you need to do is correct the markup. If you look here , you will see 18 errors in your markup.

The main problem is the <font> tag that is inside the <ul> . You can only place <li> tags inside of <ul> and then place whatever elements you need inside <li> .

<font> tag is deprecated and you should use CSS to style your elements.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM