Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/388.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何创建导航链接_Javascript_Html_Css - Fatal编程技术网

Javascript 如何创建导航链接

Javascript 如何创建导航链接,javascript,html,css,Javascript,Html,Css,我想创建如下html导航链接: 但是我不知道如何隐藏html下划线以及如何更改默认的html颜色。你能给我举个基本的例子吗?很有趣,你已经有了导航栏 a{color: green; text-decoration: none;} 要禁用带下划线的文本,请使用css“文本装饰:无;” 要设置“a”的颜色,请使用“color:rgb(256256);”或使用“color:#000000;” a{ 文字装饰:无; 颜色:rgb(256256); } HTML: <ul> <

我想创建如下html导航链接:


但是我不知道如何隐藏html下划线以及如何更改默认的html颜色。你能给我举个基本的例子吗?

很有趣,你已经有了导航栏

a{color: green; text-decoration: none;}
  • 要禁用带下划线的文本,请使用css“文本装饰:无;”
  • 要设置“a”的颜色,请使用“color:rgb(256256);”或使用“color:#000000;”

    a{
    文字装饰:无;
    颜色:rgb(256256);
    }

  • HTML:

    <ul>
        <li>GeForce > <a href="#">Link 1</a></li>
        <li>GeForce > <a href="#">Link 2</a></li>
        <li>GeForce > <a href="#">Link 3</a></li>
    </ul>
    

    现场演示:

    要隐藏下划线并添加颜色,您的答案是CSS

    下面是一个例子:

    HTML:

    请点击此处:


    如果您有任何问题,请毫不犹豫地提问:)

    请展示一些您已经尝试过的代码。谷歌“css文本装饰”:例如,您将学习如何无下划线。尝试使用firefox firebug查看其他人是如何做的
    <ul class="navigation-list"> <!--the name 'navigation-list' is arbitrary-->
    <li><a href="#">Home</a></li>
    <li><a href="#">Products</a></li>
    <li><a href="#">About</a></li>
    <li><a href="#">Contact</a></li>
    </ul>​
    
    ul.navigation-list {
        background-color: rgb(30,30,30);
        height:35px;
    }
    
    
    ul.navigation-list li{
        float:left;}
    
    ul.navigation-list li a{
        padding:4px 8px;
        text-decoration:none; /**this removes the underline part **/
        color:rgb(250,250,250);
        font-family:Verdana;
    
    }
    
    ul.navigation-list li a:hover{
        text-decoration:underline; /**this adds the underline part **/
        background-color:rgb(80,80,80);
    }