2017-08-23 2 views
0

I want to have a fixed top navbar like this with (Because its one list item I dont need the hamburger toggleable feature)élément de marque Bootstrap 4 pousser à une barre de navigation nouvelle ligne

Cependant, l'élément de marque navbar a poussé la navigation à une nouvelle ligne. J'ai essayé la classe pull-right et une justification-content-end mais plus néant d'entre eux a fonctionné.

It looks like this.

Mon code est à ce jour comme celui-ci. Merci de votre aide!

body{ 
 
\t padding-top: 130px; 
 
} 
 

 
.navbar{ 
 
\t padding-top: 1rem; 
 
\t padding-bottom: 2rem; 
 
\t height: 130px; 
 
} 
 

 
.bg-faded{ 
 
\t background-color: white; 
 
} 
 

 
.navbar-brand{ 
 
\t font-family: 'Lato', sans-serif; 
 
\t font-size: 2.20rem; 
 
\t color: rgba(0, 0, 0, 1); 
 
\t font-weight: 900; 
 
} 
 

 

 
.nav-item a{ 
 
\t font-family: 'Lato', sans-serif; 
 
\t font-size: 0.8rem; 
 
\t color: rgba(0, 0, 0, 1); 
 
\t font-weight: 900; 
 
\t text-transform: uppercase; 
 
} 
 

 
.jumbotron{ 
 
\t margin-bottom: 0; 
 
} 
 

 
#week1{ 
 
    background-image: url('../img/week1.jpg'); 
 
    background-repeat: no-repeat; 
 
    background-position: center; 
 
    background-size:100%; 
 
}
<!DOCTYPE html> 
 
<html lang="en"> 
 
    <head> 
 
    \t <title>52 Weeks of Portrait</title> 
 
    <!-- Required meta tags --> 
 
    <meta charset="utf-8"> 
 
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> 
 
    <meta http-equiv="x-ua-compatible" content="ie=edge"> 
 
    <!-- Bootstrap CSS --> 
 
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous"> 
 
    <link rel="stylesheet" href="css/my.css"> 
 
    <link href="https://fonts.googleapis.com/css?family=Lato:400,700,900|Merriweather" rel="stylesheet"> 
 
    </head> 
 
    <body> 
 
    <!-- Navigation Bar --> 
 
\t \t <nav class="navbar fixed-top navbar-light bg-faded"> 
 
\t \t \t <a class="navbar-brand" href="index.html">52 Weeks of Portrait</a> 
 
\t \t \t <ul class="nav navbar-nav justify-content-end"> 
 
\t \t \t \t <li class="nav-item"> 
 
\t \t \t \t <a class="nav-link" href="#">About + Rules</a> 
 
\t \t \t \t </li> 
 
\t \t \t </ul> 
 
\t \t </nav> 
 
\t \t <div class="jumbotron jumbotron-fluid" id="week1"> 
 
\t \t <div class="container"> 
 
\t \t  <h1 class="display-3">Week One</h1> 
 
\t \t  <p class="lead"></p> 
 
\t \t </div> 
 
\t \t </div> 
 
\t \t 
 
\t \t 
 
\t \t 
 
\t 
 
    <!-- jQuery first, then Tether, then Bootstrap JS. --> 
 
    <script src="https://code.jquery.com/jquery-3.1.1.slim.min.js" integrity="sha384-A7FZj7v+d/sdmMqp/nOQwliLvUsJfDHW+k9Omg/a/EheAdgtzNs3hpfag6Ed950n" crossorigin="anonymous"></script> 
 
    <script src="https://cdnjs.cloudflare.com/ajax/libs/tether/1.4.0/js/tether.min.js" integrity="sha384-DztdAPBWPRXSA/3eYEEUWrWCy7G5KFbe8fFjk5JAIxUYHKkDx6Qin1DkWx51bBrb" crossorigin="anonymous"></script> 
 
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/js/bootstrap.min.js" integrity="sha384-vBWWzlZJ8ea9aCX4pEW3rVHjgjt7zpkNpZk+02D9phzyeVkE+jo0ieGizqPLForn" crossorigin="anonymous"></script> 
 
    </body> 
 
</html>

+0

Si je comprends bien, vous voulez un tel effet? https://jsfiddle.net/06fv6ona/1/ – Alex

Répondre