html5中侧边栏导航·怎样写

html-css015

html5中侧边栏导航·怎样写,第1张

侧边栏导航标签:

<aside>

<nav>

<ul>

<li>菜单一</li>

<li>菜单二</li>

<li>菜单三</li>

<li>菜单四</li>

<li>菜单五</li>

</ul>

</nav>

</aside>

样式自己加。

 <!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">

    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>Document</title>

    <style>

        *{

            margin:0

            padding:0

        }

       ul{

           list-style: none

           background-color: black

           color:blanchedalmond

           width: 100px

           line-height: 48px

       }

       li:nth-of-type(2n+1){

        background-color: blue

       }

       li:hover{

           color: red

           background-color: yellow

       }

    </style>

</head>

<body>

    <ul>

        <li>1</li>

        <li>2</li>

        <li>3</li>

        <li>4</li>

        <li>5</li>

        <li>6</li>

        <li>7</li>

        <li>8</li>

    </ul>

</body>

</html>

 请采纳