html - 将TopBar填充到屏幕末尾

标签 html css

所以我创建了一个带有注册和登录按钮的导航栏(更像是一个顶部栏),但我遇到了一个小问题,它会填满我的整个显示器。它刚好在触及屏幕末端之前停止。任何修复? http://jsfiddle.net/Karmatix/ngfrzuas/
如果您想在此处查看我的代码。

html

<!doctype html>
<html>
<head>
<meta charset="utf-8">
    <title>League of Legion</title>
    <link rel="stylesheet" type="text/css" href="page.css" />
</head>
<body>
<div id="top-background">
        <div id="wrapper">
            <!-- Everything in the top Nav -->
            <div id="Register-Text">
                <ul>
                    <li><p>Don't have an account?</p> <a href="#">Register</a></li>
                    <li><a href="#">Login</a></li>
                </ul>
            </div>
            <!-- End of everything in the top Nav -->
        </div>
    </div>
</body>
</html>

CSS

#top-background {
    background-color: #000000;
    margin-top: -9px;
    position: relative;
}

#wrapper {
    background-color: #000000f;
    max-width: 1100px;
    min-width: 720px;
    margin-left: auto;
    margin-right: auto;
    margin-top: -16px;
}

/*Beginning of top Nav styling */
#Register-Text {
    overflow: auto;
}

#Register-Text ul li {
    color: white;
    display: inline;
    list-style-type: none;
    float: right;
    padding-left: 20px;
    margin-bottom: 10px;
}

#Register-Text ul li p {
    display: inline;
    color: #999;
}

#Register-Text ul li a {
    color: white;
    text-decoration: none;
}

#Register-Text ul li a:hover {
    color: #93C;
}
/* End of top Nav Styling */

最佳答案

你可以这样做:

body {
    padding: 0;
    margin: 0;
}

我喜欢添加某种 CSS 重置来尝试规范化浏览器之间的所有默认样式。查看 Eric Meyer 的 http://www.cssreset.com/scripts/eric-meyer-reset-css/ .这是我喜欢的。

关于html - 将TopBar填充到屏幕末尾,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27955086/

相关文章:

javascript - 未从输入框中提取值

php - 如何解决创建多个静态页面的问题

html - 在水平行中的网页框

javascript - 如何定位特定类(class)的最后一个 child

javascript - slider 旋转不显示 slider 中的所有幻灯片

css - 如何使 `li` 元素的树彼此正确靠近

如果数据值为 true,则 jQuery 添加类

javascript - 想要使用 javascript 显示和隐藏下拉菜单

javascript - 检测何时加载 Facebook Like 按钮

html - 宽度上的左右边距 100%