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 让标签向右移动?_Html_Css - Fatal编程技术网

Html 让标签向右移动?

Html 让标签向右移动?,html,css,Html,Css,以下是我迄今为止所做的工作: <html> <head> <style> /* Tabs */ #navlist { padding: 3px 0; margin-left: 0; border-bottom: 1px solid #778; font: bold 12px Verdana, sans-serif; /* WARNING: when using font-size

以下是我迄今为止所做的工作:

<html>
<head>
<style>

/* Tabs */
#navlist {
        padding: 3px 0;
        margin-left: 0;
        border-bottom: 1px solid #778;
        font: bold 12px Verdana, sans-serif;
        /* WARNING: when using font-size/font-family instead of font, 
           do not forget to set line-height:normal otherwise 1px more is shown
           between tabs and their bottom line in IE8 and FF3.6 */
}

#navlist li {
        list-style: none;
        margin: 0;
        display: inline;
}

#navlist li a {
        padding: 3px 0.5em;
        margin-left: 0px;
        border: 1px solid #778;
        border-bottom: none;
        background: #DDE;
        text-decoration: none;
}

#navlist li a:link { color: #448; }
#navlist li a:visited { color: #667; }

#navlist li a:hover {
        color: #000;
        background: #AAE;
        border-color: #227;
}

#navlist li a#current {
        background: white;
        border-bottom: 1px solid white;
}
</style>
</head>
<body>
                <div id="navcontainer">
                        <ul id="navlist">
                                    <li><a id="current" href="#">Col1</a></li>
                                    <li><a href="#">Col2</a></li>
                                    <li><a href="#">Col3</a></li>
                            </ul>
                </div>
</body>
</html>​

/*标签*/
#导航列表{
填充:3px0;
左边距:0;
边框底部:1px实心#778;
字体:粗体12px Verdana,无衬线;
/*警告:使用字体大小/字体系列而不是字体时,
不要忘记设置线高度:正常,否则显示1px以上
在IE8和FF3.6中的选项卡及其底线之间*/
}
#李海军{
列表样式:无;
保证金:0;
显示:内联;
}
#海军陆战队{
填充物:3p0.5em;
左边距:0px;
边框:1px实心#778;
边框底部:无;
背景:#DDE;
文字装饰:无;
}
#导航列表LIA:链接{颜色:#448;}
#导航列表李a:访问{color:#667;}
#导航列表李a:悬停{
颜色:#000;
背景:#AAE;
边框颜色:#227;
}
#导航列表李a#当前{
背景:白色;
边框底部:1px纯白;
}

它被保存到。感谢您的帮助

只需添加
文本对齐:右
#导航列表
css


说明:您正在使列表项成为内联元素。这使得它们遵循适用于文本的一般规则。因此,通过简单地设置文本对齐,您就可以指定内联元素的对齐位置。

+1简单使用HTML+CSS制作选项卡的绝佳示例。我在你的代码中添加了一个小注释,因为我在发现IE8/FF3.6中的问题之前两个小时撞到了头。