I want to align the button links and the “Donate” button, i.e. make them begin at the same position. I’ve tried using the grid system, but the result was not satisfactory.
Here is the fiddle.
<head>
<title>
Test
</title>
<!-- Bootstrap -->
<link href="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div class="header">
<nav class="navbar navbar-default navbar-static-top">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav navbar-right" style="margin: 0">
<li><a href="#">Log In</a>
</li>
<li>
<p class="navbar-btn">
<a href="#" class="btn btn-danger btn-block">Donate</a>
</p>
</li>
</ul>
</div>
<!--/.nav-collapse -->
</div>
</nav>
</div>
</body>
2
Answers
If by “make them begin at the same position” you mean make both buttons left aligned, then all you have to do is simply apply
text-align: left
to the button (.navbar-btn .btn-danger
).https://jsfiddle.net/azizn/mou33Lkz/
I don’t know what exactly you are trying to ask here. I mean do you want
"donate"
to align with the link text. If that’s what you want you can apply this css-