htmlcssbootstrap-4

HTML and CSS <nav> links positioning - BOOTSTRAP 4


i need help with positioning my nav bar links. I will include my code so please tell me where i am wrong. Using Bootstrap for grid. Problem is that my nav bar is not full width inside that div, even when set margins to 0 , when i set width 100% its stacked vertical. `

<body>
    <div class="container">
        <div class="row">
            <div class="col-12">
                <h1>Web Engineering</h1>
            </div>
        </div>
    <div class="row">
        <div class="col-12">
            <nav class="nav">
                <a href="#">ABOUT</a>
                <a href="#">PORTFOLIO</a>
                <a href="#">CONTACT</a>
            </nav>
        </div>
    </div>
</div>`

Didnt include any CSS bcs non of my CSS code is working what i want to do. TASK: Float right my links and center them in middle of a DIV while my logo float left.


Solution

  • You can do a quick fix with css on

    .nav > a { 
        float: left;
        margin-rigth: 10px; 
    } 
    

    and on end clear both

    .clear-div {
        clear: both;
    }