st7th st7th - 2 months ago 39
CSS Question

Bootstrap 4 branding element pushing navbar to a new line

I want to have a fixed top navbar like this with (Because its one list item I dont need the hamburger toggleable feature)

However the navbar brand element pushed the navigation to a new row. I tried the pull-right class and a justify-content-end but neighter of them worked.

It looks like this.

My code so far is like this. Thank you for your help!

padding-top: 130px;

padding-top: 1rem;
padding-bottom: 2rem;
height: 130px;

background-color: white;

font-family: 'Lato', sans-serif;
font-size: 2.20rem;
color: rgba(0, 0, 0, 1);
font-weight: 900;

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

margin-bottom: 0;

background-image: url('../img/week1.jpg');
background-repeat: no-repeat;
background-position: center;

<!DOCTYPE html>
<html lang="en">
<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="" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous">
<link rel="stylesheet" href="css/my.css">
<link href=",700,900|Merriweather" rel="stylesheet">
<!-- Navigation Bar -->
<nav class="navbar fixed-top navbar-light bg-faded">
<a class="navbar-brand" href="index.html">52 Weeks of Portrait</a>
<ul class="nav navbar-nav justify-content-end">
<li class="nav-item">
<a class="nav-link" href="#">About + Rules</a>
<div class="jumbotron jumbotron-fluid" id="week1">
<div class="container">
<h1 class="display-3">Week One</h1>
<p class="lead"></p>

<!-- jQuery first, then Tether, then Bootstrap JS. -->
<script src="" integrity="sha384-A7FZj7v+d/sdmMqp/nOQwliLvUsJfDHW+k9Omg/a/EheAdgtzNs3hpfag6Ed950n" crossorigin="anonymous"></script>
<script src="" integrity="sha384-DztdAPBWPRXSA/3eYEEUWrWCy7G5KFbe8fFjk5JAIxUYHKkDx6Qin1DkWx51bBrb" crossorigin="anonymous"></script>
<script src="" integrity="sha384-vBWWzlZJ8ea9aCX4pEW3rVHjgjt7zpkNpZk+02D9phzyeVkE+jo0ieGizqPLForn" crossorigin="anonymous"></script>

Answer Source

Wrap your brand to div with class 'navbar-header' and use:




to .navbar-nav