2017-04-19 3 views
0

Ich kann die Links in der Navigationsleiste nicht anklicken. Ich habe überall online nachgesehen und festgestellt, dass die Leute die Links in href ähnlich wie bei mir referenziert haben.Navigationslink nicht anklickbar

<div class="Navigation"> 
      <asp:ContentPlaceHolder ID="ContentPlaceHolder2" runat="server"> 
       <ul> 
        <li><a href="SplashPage.aspx"></a> Home</li> 
        <li><a href="Customer/Register.aspx"></a>Register</li> 
        <li><a href="Customer/Login.aspx"></a>Login</li> 
        <li>Customer 
         <ul> 
          <li> <a href="Customer/HomePage.aspx"></a>Make an Order</li> 
         </ul> 
        </li> 
        <li>Employee 
         <ul> 
          <li><a href="Employee/Modifications.aspx"></a>Modify Menu</li> 
          <li><a href="Employee/PaymentStatus.aspx"></a>Payment Status</li> 
          <li><a href="Employee/Reports.aspx"></a>Report</li> 
         </ul> 
        </li> 
       </ul> 
       <br /> 
       <br /> 
       <br /> 
      </asp:ContentPlaceHolder> 
     </div> 

Unten ist das CSS. Ich weiß nicht, ob irgendetwas in der CSS beeinflusst haben könnte ich in der Lage sein die Links

ul { 
    list-style: none; 
} 

li { 
    background-color: yellow; 
    width: 150px; 
    height: 30px; 
    text-align: center; 
    float: left; 
    color:black; 
    position:relative; 
    border-radius:10px; 
} 
/*when you hover over the link it is green*/ 
    li:hover { 
     background-color:greenyellow; 
    } 
/*adjust the submenus*/ 
* { 
    margin:0px; 
    padding:0px; 
} 
/*hide submenus*/ 
ul ul{ 
    display:none; 
} 

/*when submenus are hovered over they are white*/ 
ul li li:hover { 
    background-color:white; 
} 
/*make submenus appear when thier parent menu is hovered over*/ 
ul li:hover > ul { 
    display:block; 
} 
ul ul ul { 
    margin-left:150px; 
    top: 0px; 
    position:absolute; 
} 

Antwort

1

Ihr Code klicken funktioniert, aber Sie hatten alle Textnavigation außerhalb des a (Anker) Tages aus irgendeinem Grunde sitzen.

Ihre aktuellen Links wie folgt aussehen:

<a href="SplashPage.aspx"></a> Home 

Verbindungen sollte sein:

<a href="SplashPage.aspx">Home</a> 

den Code Unten:

ul { 
 
    list-style: none; 
 
} 
 

 
li { 
 
    background-color: yellow; 
 
    width: 150px; 
 
    height: 30px; 
 
    text-align: center; 
 
    float: left; 
 
    color:black; 
 
    position:relative; 
 
    border-radius:10px; 
 
} 
 
/*when you hover over the link it is green*/ 
 
    li:hover { 
 
     background-color:greenyellow; 
 
    } 
 
/*adjust the submenus*/ 
 
* { 
 
    margin:0px; 
 
    padding:0px; 
 
} 
 
/*hide submenus*/ 
 
ul ul{ 
 
    display:none; 
 
} 
 

 
/*when submenus are hovered over they are white*/ 
 
ul li li:hover { 
 
    background-color:white; 
 
} 
 
/*make submenus appear when thier parent menu is hovered over*/ 
 
ul li:hover > ul { 
 
    display:block; 
 
} 
 
ul ul ul { 
 
    margin-left:150px; 
 
    top: 0px; 
 
    position:absolute; 
 
}
<div class="Navigation"> 
 
      <asp:ContentPlaceHolder ID="ContentPlaceHolder2" runat="server"> 
 
       <ul> 
 
        <li><a href="SplashPage.aspx">Home</a></li> 
 
        <li><a href="Customer/Register.aspx">Register</a></li> 
 
        <li><a href="Customer/Login.aspx">Login</a></li> 
 
        <li>Customer 
 
         <ul> 
 
          <li> <a href="Customer/HomePage.aspx">Make an Order</a></li> 
 
         </ul> 
 
        </li> 
 
        <li>Employee 
 
         <ul> 
 
          <li><a href="Employee/Modifications.aspx">Modify Menu</a> </li> 
 
          <li><a href="Employee/PaymentStatus.aspx">Payment Status</a></li> 
 
          <li><a href="Employee/Reports.aspx">Report</a></li> 
 
         </ul> 
 
        </li> 
 
       </ul> 
 
       <br /> 
 
       <br /> 
 
       <br /> 
 
      </asp:ContentPlaceHolder> 
 
     </div>

1

Platzieren Sie Ihren Linktext in Ihre Anchor-Tags!

<div class="Navigation"> 
      <asp:ContentPlaceHolder ID="ContentPlaceHolder2" runat="server"> 
       <ul> 
        <li><a href="SplashPage.aspx">Home</a> </li> 
        <li><a href="Customer/Register.aspx">Register</a></li> 
        <li><a href="Customer/Login.aspx">Login</a></li> 
        <li>Customer 
         <ul> 
          <li> <a href="Customer/HomePage.aspx">Make an Order</a></li> 
         </ul> 
        </li> 
        <li>Employee 
         <ul> 
          <li><a href="Employee/Modifications.aspx">Modify Menu</a></li> 
          <li><a href="Employee/PaymentStatus.aspx">Payment Status</a></li> 
          <li><a href="Employee/Reports.aspx">Report</a></li> 
         </ul> 
        </li> 
       </ul> 
       <br /> 
       <br /> 
       <br /> 
      </asp:ContentPlaceHolder> 
     </div> 

Wenn Sie den Standard-Link-Styling entfernen möchten, zielen nur die <a> tag:

a{ 
    text-decoration: none; 
    color: black; 
}