html - 如何在 Bootstrap 中更改导航栏的边框半径?

标签 html twitter-bootstrap css nav

我正在尝试更改/删除导航栏组件的边框半径。我尝试了这里讨论的解决方案,How to remove the "border-radius" of the navbar-inverse in Bootstrap 3? .

我创建了一个 fiddle :https://jsfiddle.net/fts1b0z9/

HTML:

<!DOCTYPE html>
{% autoescape true %}
<html lang="en">
<head>
  <title>Bootstrap Case</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link type="text/css" rel="stylesheet" href="/stylesheets/main.css"/>
  <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
  <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
</head>
<body>

<div class = "mainDiv">
    <nav class="navbar navbar-inverse" style="border-radius:none !important">
      <div class="container-fluid">
        <div class="navbar-header" style="border-radius:none !important">
          <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>                        
          </button>
          <a class="navbar-brand" href="#">Website</a>
        </div>
        <div class="collapse navbar-collapse" id="myNavbar">
          <ul class="nav navbar-nav navbar-right">
            <li><a href="#"><span class="glyphicon glyphicon-log-in"></span> Login</a></li>
          </ul>
        </div>
      </div>
    </nav>

    <div class="container">
      <h3>Collapsible Navbar</h3>
      <p>In this example, the navigation bar is hidden on small screens and replaced by a button in the top right corner (try to re-size this window).
      <p>Only when the button is clicked, the navigation bar will be displayed.</p>
    </div>
</div>
</body>
</html>
{% endautoescape %}

CSS:

.navbar-header{
    color: #5e0231;
    background-color: #5e0231;
}

.container-fluid{
    color: #5e0231;
    background-color: #5e0231;
    width:1000px;
}
.mainDiv{
    width:1000px;
    position: fixed;
    top: 25%;
    left: 50%;
    transform: translate(-50%, -50%);
}

如果您注意到,栗色会溢出边界。我不确定如何解决这个问题。

如果有人能帮我解决这个问题就太好了。

谢谢!!

最佳答案

最简单的:

.navbar-inverse {
  border-radius: 0;
}

不工作?或者这不是你的意思?

关于html - 如何在 Bootstrap 中更改导航栏的边框半径?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36851736/

相关文章:

html - 如何将列内容放在底部?

javascript - 从 JSON 文件加载变量到 LESS CSS 预处理器

java - 从类路径外的目录加载资源时出现 NPE

javascript - 为什么网站收不到 POST 请求?

javascript - 如何下载Mozilla的开发者文档供离线阅读?

html - 如何让按钮在不同的 div 中对齐?

html - Bootstrap : Changing column order

html - 将图像设置为网页的背景(屏幕宽度)

html - 表单提交后将纯html发送到mysql

css - 在页面底部向左浮动 div