html - 100% 宽度 CSS 导航栏菜单

标签 html css nav

我做了一个导航栏,但我不能让它全宽。

图像预览: enter image description here

我想要全宽且没有填充,如下所示: enter image description here

#cssmenu {
  width: 100%;
  font-family: Raleway, sans-serif;
  line-height: 1;
  border-bottom: 4px solid #1CE678;

}
#cssmenu > ul {
  background: #3db2e1;

}
#cssmenu > ul > li {
  float: right;
  -webkit-perspective: 1000px;
  -moz-perspective: 1000px;
  perspective: 1000px;
}


<div id='cssmenu'>
            <ul>
                <li><a href='#'>1</a></li>
                <li><a href='#'>2</a></li>
                <li><a href='#'>3</a></li>
                <li><a href='#'>4</a></li>
                <li class='active'><a href='#'>5</a></li>
            </ul>
        </div>

最佳答案

尝试删除 body 边距:

body { margin: 0; }

关于html - 100% 宽度 CSS 导航栏菜单,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46865788/

相关文章:

html - 将导航中的图片/Unicode 字符与 Flexbox 中的文本对齐 (html/css)

html - 如何使这个下拉菜单在导航栏下方全宽?

javascript - jQuery 输入值在 html 渲染后不会立即更改

css - Bootstrap 导航栏定位在其他 div 的底部

html - CSS - 将导航环绕在 Logo 图像周围(响应式)

html - CSS3 Div 动画

javascript - 页面顶部的 CSS 菜单

javascript - 交换图像的过渡

html - Bootstrap : Center a header within a div

html - CSS 选择器 : find dd element corresponding to a dt tag?