Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/73.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
Html a中的两个超链接<;李>;列表项_Html_Css_Hyperlink_Listitem - Fatal编程技术网

Html a中的两个超链接<;李>;列表项

Html a中的两个超链接<;李>;列表项,html,css,hyperlink,listitem,Html,Css,Hyperlink,Listitem,如何在li项目中并排插入两个超链接 在下面的html代码中,我需要将“login”和“register”链接并排放置,并用“|”分隔。以下代码中需要进行哪些修改才能完成任务 谢谢 html文件: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://w

如何在li项目中并排插入两个超链接

在下面的html代码中,我需要将“login”和“register”链接并排放置,并用“|”分隔。以下代码中需要进行哪些修改才能完成任务

谢谢

html文件:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"></html> 
<html> 
<head> 
        <link href="styledel.css" rel="stylesheet" type="text/css" />
</head> 

<body>
<div id="navcontainer">
                <ul id="navlist">   
                     <li><a href="index.php">Home</a></li>
                    <li><a href="index.php">The Tool </a>                       
                        <ul id="subnavlist">
                            <li><a href="subtitle1.php" target = "_blank">Secondary Link</a></li>
                    </ul>
                        </li>
                    <li><a href="tutorials.php">Tutorials &AMP; FAQs</a></li>
                <li><a href="login.php" target="_blank">Login</a> | <a href="user_add.php" target="_blank">Register</a></li>      
        </ul>
</div>

</body>
</html>

非常感谢

UAs现在的代码是,链接应该并排。如果他们不知道,那是因为他们没有足够的空间。这可能是因为您设置的宽度太小,或者边距和填充减少了可用空间

如果希望列表项在一行中,可以对其使用
display:inline

#nav li{display:inline}
ul{list-style:none;} /* because you don't want a list with inline items to have bullets. */

现在的代码是UAs,链接应该并排。如果他们不知道,那是因为他们没有足够的空间。这可能是因为您设置的宽度太小,或者边距和填充减少了可用空间

如果希望列表项在一行中,可以对其使用
display:inline

#nav li{display:inline}
ul{list-style:none;} /* because you don't want a list with inline items to have bullets. */

尝试将一点CSS从
标记切换到
  • 元素,如下所示,从
    li a
    中删除
    显示:block
    ,并将边框装饰移动到
    li
    。然后,在有
    #navcontainer li
    的地方,通过设置
    边框左:0px
    边框右:0px来移除边框装饰

    #navcontainer  li
    {
     padding: 5px .3em 5px .3em;
     border-left: .3em solid #1958b7;
    border-right: .3em solid #508fc4;
    border-bottom: 1px solid #90bade; /*separator*/
    margin: 0;
    }
    
    
    
    
    
    color: #004963;
    text-decoration: none;
    }
    
    #navcontainer li a:hover  /*behavior on hover */
    {
    background-color: #ffffff;
    color: #ad0000; 
    }
    
    #navcontainer li li   /*sub menu*/
    {   
    border-top: 1px solid #90bade;
    border-bottom: 0;
    margin: 0;
    font-family: 'Courier New',Courier,monospace;
    font-size: 13px;
    border-left:0px;
    border-right:0px;
    }
    
    #navcontainer li li a  /* sub menu */
    {
    padding: 4px 4px 4px 15px;
    color: #5b6f7b /* light slate color: #00788a  color of text */
    }
    /* navigation menu end */​
    

    尝试将一点CSS从
    标记切换到
  • 元素,如下所示,从
    li a
    中删除
    显示:block
    ,并将边框装饰移动到
    li
    。然后,在有
    #navcontainer li
    的地方,通过设置
    边框左:0px
    边框右:0px来移除边框装饰

    #navcontainer  li
    {
     padding: 5px .3em 5px .3em;
     border-left: .3em solid #1958b7;
    border-right: .3em solid #508fc4;
    border-bottom: 1px solid #90bade; /*separator*/
    margin: 0;
    }
    
    
    
    
    
    color: #004963;
    text-decoration: none;
    }
    
    #navcontainer li a:hover  /*behavior on hover */
    {
    background-color: #ffffff;
    color: #ad0000; 
    }
    
    #navcontainer li li   /*sub menu*/
    {   
    border-top: 1px solid #90bade;
    border-bottom: 0;
    margin: 0;
    font-family: 'Courier New',Courier,monospace;
    font-size: 13px;
    border-left:0px;
    border-right:0px;
    }
    
    #navcontainer li li a  /* sub menu */
    {
    padding: 4px 4px 4px 15px;
    color: #5b6f7b /* light slate color: #00788a  color of text */
    }
    /* navigation menu end */​
    

    你能详细说明一下吗。我需要在css文件中添加什么?如何在html文件中引用它?如果我将上述行添加到css文件中,则不会发生任何事情。谢谢你。我需要在css文件中添加什么?如何在html文件中引用它?如果我将上述行添加到css文件中,则不会发生任何事情。ThanksI认为宽度不是问题,因为两个链接显示在不同的行中。我的一些文本比这两行长。不帮助,(登录,|,注册)跨越三行。我认为宽度不是问题,因为两个链接显示在不同的行中。我的一些文本比这两行长。不帮助,(登录,|,注册)跨越三行。虽然这可能会回答问题,但请添加一些说明,说明您所做的更改,以及这些更改将如何帮助解决问题。另外,您可能知道(假设您的代表>400),但您可能希望查看页面以获得有关格式的指导。我想在您发布此内容时,您正在尝试添加此内容。啊,在这种情况下,我很抱歉耽误了您的时间=/更改“navcontainer li a”可以解决问题,但会打乱所有其他设置。您是否实现了所有更改?请看看这个。我已经在Chrome、FF和IE 7-9中看到了它,它看起来像你想要的那样工作。虽然这可能回答了问题,但请添加一些解释,说明你所做的更改,以及这些更改将如何帮助解决问题。另外,您可能知道(假设您的代表>400),但您可能希望查看页面以获得有关格式的指导。我想在您发布此内容时,您正在尝试添加此内容。啊,在这种情况下,我很抱歉耽误了您的时间=/更改“navcontainer li a”可以解决问题,但会打乱所有其他设置。您是否实现了所有更改?请看看这个。我已经在Chrome、FF和IE 7-9中看到了它,它看起来像你想要的那样工作。