سؤال

كان لدي قائمة فرعية من Mouseover تعمل بشكل جيد للغاية على موقعي (بشكل جيد للغاية في الواقع لدرجة أنه كان يعمل بشكل صحيح في Chrome ، أي 7 و 8 ، و FF) ، لكنه الآن مكسور بطريقة أو بأخرى ولا يمكنني رؤية المشكلة.

ها هي CSS:

.MainMenu {
    width: 90% !important;
    min-width: 800px;
    height: 42px !important;
    padding: 0 0 0 10%;
    overflow: hidden;
    border-top: 1px solid #0054a6;
    border-bottom: 1px solid #0054a6;
    background: transparent url("Images/ServiceMenuBG.png");
    background-repeat: repeat-x;
}
.MainMenu ul {
    padding: 0;
    margin:0;
    list-style: none;
}
.MainMenu li {
    float: left;
    position: relative;
    height: 31px;
    width: 150px;
    padding: 11px 0 0 0;
    text-align: center;
    border-right: 1px solid #0054a6;
}
.MainMenuItem#First { border-left: 1px solid #0054a6; }
.MainMenuItem a {
    color: #ffffff;
    display: block;
    height: 31px;
    width: 150px;
    font-weight: bold;
    text-decoration: none;
}
.MainMenuItem:hover { background: transparent url("Images/ServiceMenuBG.png") repeat-x 0 -42px; }
.SubMenu {
    z-index: 500;
    display: none;
    width: 150px !important;
    position: absolute;
    top: 10px;
    left: 0;
    background-color: rgb(51,118,184);
}
.SubMenu li { padding: 0 0 2px 5px; height: 20px !important; width: 143px; }
.SubMenu li a {
    height: 20px !important;
    font-weight: normal;
    color: #ffffff;
    text-align: left;
    text-decoration: none;
}
.SubMenu li a:hover { text-decoration: underline; }
.MainMenu li.MainMenuItem>ul { top: auto; left: auto; }
.MainMenu li.MainMenuItem:hover ul { display: block; }'

ها هي HTML:

<div class="MainMenu">
    <ul>
        <li class="MainMenuItem" id="First"><a href="~/Default.aspx">Home</a></li>
        <li class="MainMenuItem"><a href="Pages/Philosophies.aspx">Philosophies</a></li>
        <li class="MainMenuItem"><a href="Pages/Services.aspx#top">Services</a>
            <ul class="SubMenu">
                <li id="TopItem"><a href="Pages/Services.aspx#shop">Shop Repair</a></li>
                <li><a href="Pages/Services.aspx#donations">Donations</a></li>
                <li><a href="Pages/Services.aspx#consulting">Consulting</a></li>
                <li id="BottomItem"><a href="Pages/Services.aspx#on-site">On-site Service</a></li>
            </ul>
        </li>
        <li class="MainMenuItem"><a href="Pages/Contracts.aspx">Contracts</a></li>
        <li class="MainMenuItem"><a href="Pages/AboutUs.aspx">About Us</a></li>
        <li class="MainMenuItem"><a href="Pages/ContactUs.aspx">Contact Us</a></li>
    </ul>
</div>

لا يتم عرض القائمة الفرعية إما على Mouseover أو إذا قمت بتعيينه أولي display خاصية ل block. يبدو الأمر كما لو أنه غير موجود على الصفحة على الإطلاق.

شكرا مقدما على أي مساعدة.

هل كانت مفيدة؟

المحلول

.MainMenu { overflow: hidden; }

يخفي القوائم الفرعية ، لذا أزل هذا الخط. السطر 6 في CSS الخاص بك.

كما ذكر سوتيريس

.MainMenuItem a { color: #ffffff; }

يخفي عناصر القائمة العليا (ربما ليس على الإصدار الخاص بك لأنني أرى أن لديك صورة خلفية)

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top