S
S
Sieghardt Meisner2015-11-14 12:59:56
css
Sieghardt Meisner, 2015-11-14 12:59:56

How in Bootstrap3 Navbar to align a button with a 2-column indent from the right edge?

With the code that I have, the "My Account" button is just right-aligned, and I need to indent from this edge by 1 or 2 columns. How to do it?
I am attaching a listing:

<!DOCTYPE html>
<html lang="ru">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>ЯРГА</title>

    <!-- Bootstrap CSS -->
    <link href="http://netdna.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet">
    <link href="weidmanns.css" rel="stylesheet">

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
      <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
  </head>
  <body>
    <header>
      <nav class="navbar navbar-default top" role="navigation">				
        <div class="container-fluid">
          <div class="col-md-2"></div>
          <div class="navbar-header">
            <a class="navbar-brand" rel="home" href="#" title="Buy Sell Rent Everyting">
        		<img style="max-width:150px; margin-top: -7px;"
             src="D:\Sieggikods\JaRGA\image\logo.png"></a>
          </div>
          <div class="col-md-1"></div>
          <form class="navbar-form navbar-left" role="search">
            <div class="form-group">
              <input type="text" class="form-control" placeholder="Поиск по сайту">
            </div>
            <button type="submit" class="btn btn-custom">Искать</button>
        	</form>
        	<!--<div class="col-md-3"></div>-->
          <form class="navbar-form navbar-right col-md-offset-2">
          	<button type="button" class="btn btn-custom">Личный кабинет</button>
          </form>   
          <div class="col-md-2"></div>   
        </div>
      </nav>
    </header>
  </body>
</html>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis, 2015-11-14
@S1egh4rdt

Replace offset with push
If you use less, the mixin will look like this:

.your-class {
    .make-md-column-push(2);
}

<div class="col-md-2 col-md-push-2">
  <form class="navbar-form navbar-right">
    <button type="button" class="btn btn-custom">Личный кабинет</button>
  </form>  
</div>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question