Mobile and tablet screen resolutions determine the position of the navigation toggle button

I've been stuck on this issue for days now and would really appreciate some help sorting it out. I'm trying to position the hamburger icon on the right side, a contact picture with a phone number in the middle, and a brand logo on the left. For some reason, the toggler is being pushed outside its col-3 grid. I'm using Bootstrap 4.

 <header>
        <div class="container-fluid">
            <div class="row">
                <div class="col-5 col-sm-4 col-md-5 col-lg-4 col-xl-4">
                    <img class="logo img-fluid" src="/img/logo.png" alt="logo">
                </div>
                <div class="col-4 col-sm-5 col-md-5 col-lg-4 col-xl-3">
                    <div class="tel-icon">
                        <img class="contact img-fluid" src="/img/contact.png" alt="contact-icon">
                    </div>
                </div>
                <div class="col-3 col-sm-3 col-md-2 col-lg-4 col-xl-4">
                    <nav class="navbar navbar-expand-lg bg-none">
                        <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarResponsive"
                                aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle Navigation">
                            <i class="fas fa-bars"></i>    
                        </button>

                        <div class="collapse navbar-collapse" id="navbarResponsive">
                            <ul class="navbar-nav ml-auto">
                                <li class="nav-item active">
                                    <a class="nav-link home" href="#">HOME</a>
                                </li>
                                <li class="nav-item">
                                    <a class="nav-link security-services" href="#">SECURITY SERVICES</a>
                                </li>
                                <li class="nav-item">
                                    <a class="nav-link contact-us" href="#">CONTACT US</a>
                                </li>
                            </ul>
                        </div>
                    </nav>
                </div>
            </div>
        </div>
    </header>




/////////collapsed nav//////////
@media (min-width: 601px) and (max-width: 991px) {
    .fa-bars {
        transform: scale(2.2, 1.3);
        -webkit-transform: scale(2.2, 1.3); /* Safari and Chrome */
        -moz-transform: scale(2.2, 1.3); /* Firefox */
        -ms-transform: scale(2.2, 1.3); /* IE 9+ */
        -o-transform: scale(2.2, 1.3); /* Opera */
        color: white;
        margin: 15px -30px 10px 20px;
    }

    .navbar-nav {
        background-color: white;
        margin: 5px 50px 30px 0px;
    }
    .navbar-nav a {
        color: #6d3093;
    }
}
@media (max-width: 600px) {
    .fa-bars {
        transform: scale(2.0, 1.2);
        -webkit-transform: scale(2.0, 1.2); /* Safari and Chrome */
        -moz-transform: scale(2.0, 1.2); /* Firefox */
        -ms-transform: scale(2.0, 1.2); /* IE 9+ */
        -o-transform: scale(2.0, 1.2); /* Opera */
        margin: 15px -30px 10px 20px;
    }
    .navbar-toggler {
        color: white;
        margin-right: 90px;
    }
    .navbar-nav {
        background-color: white;
        margin-top: 18px;
    }

    .navbar-nav a {
        color: #6d3093;
    }

Answer №1

Was this the solution you were searching for codepen

           <div class="col-4 col-sm-5 col-md-5 col-lg-4 col-xl-4 d-flex justify-content-center">
                <div class="tel-icon">
                    <img class="contact img-fluid" src="/img/contact.png" alt="contact-icon">
                </div>
            </div>
            <div class="col-3 col-sm-3 col-md-2 col-lg-4 col-xl-4 d-flex justify-content-end">

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Exploring the Benefits of jQuery History Plugin, Optimizing with Google Sitemap and

Despite searching online, I have yet to find a precise solution to my query. On my index.php page, there are two specific DIV's: #post-title and #post-content, whose content is dynamically loaded through a jQuery function triggered by clicking a link ...

jQuery wrapAll issue

I have a repeating group of three divs in my code that I need to wrap together. Here's an example from my HTML: <div class="one" /> <div class="two" /> <div class="three" /> <div class="one" /> <div class="two" /> <d ...

Clearing existing HTML content in the TR body

I've been struggling with a Jquery/Ajax call that updates cart details. Currently, I can't seem to clear the existing HTML content in the cart-body (tablebody) even though the ajax request adds all the items to the cart successfully. The code sni ...

Should a tabindex attribute be added to an input field with type="reset"?

Would adding a tabindex attribute to an input[type="reset"] serve any accessibility or semantic purpose? Or would it be better to avoid it to prevent forms from being inadvertently and frequently reset? ...

Can the outcome of a MySQL query be showcased in PHP without the need for looping?

Can I display the result of a MySQL query using an array index counter? I have a code that generates two tables for input numbers ranging from 6 to 11, dividing them equally if possible. It also generates team names incrementally (e.g., team 1, team2, ... ...

What is the best way to customize the label of Material UI's Tab component?

Is there a way to customize the text color inside the Tab component while still allowing it to change color when selected as an active Tab? For example: <Tabs centered onChange={handleChange} value={value} textColor={'secondary'} indicatorCol ...

Instructions on deploying static files to Vercel including HTML, CSS, and JavaScript files

I have encountered an issue and would like to share my solution - please see my initial response. Currently, I am facing a challenge while trying to deploy a repository from my GitHub account. The repository consists of various static files: ├─js ...

_my_custom_styles.scss are being overridden by reboot.scss

Hey there, I'm currently facing an issue where my custom CSS is getting overwritten. Even though I have placed my custom CSS beneath the CDN bootstrap reference, it doesn't seem to resolve the problem. For instance, when attempting to change the ...

Fast search using two dropdown menus

Looking to implement a search functionality with two drop down boxes using ajax. Here's the code snippet: <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <script type="text/javascript"> $(do ...

Rotation of Weekly Menus

I have a project to enhance our Menu Order Website by adding a weekly rotating menu feature. I have completed the entire website, including the admin panels, but I am struggling to implement the rotating menu functionality. Currently, all menus are include ...

What is the best way to ensure both landscape and portrait images are completely responsive and equal in height within a carousel?

I am currently working with a bootstrap carousel that contains both portrait and landscape images. On wide screens, the carousel height is automatically set to match the tallest image's height. However, this behavior results in white spaces on the top ...

Refresh table in php without the need to reload the entire page

Currently, I am retrieving data in a table from the database and have three buttons - update, delete, and an active/inactive button. Each button has its own functionality, but I need to reload the updated data in the table after any event without refreshin ...

Tips on identifying HTML email input validation using JavaScript?

Just like when you can determine whether an input element with a required attribute was successfully validated, try using the following code: if($('input[type="email"]').val() && $('input[type="email"]').val().includes('@') & ...

Only half of the image is responsive to hover effects

Just starting out with coding and running into an issue... My social media icons are supposed to turn pink on hover using a second image, but for some reason it's only showing up on the bottom half. Any suggestions? CSS: a.twitter:hover { backgr ...

Executing $(this).parent().remove() triggers a full page reload

A unique feature of my webpage is that with just a simple click of a button, users have the ability to dynamically add an endless number of forms. Each form contains fields for user input and also includes a convenient delete button. var form = " Name ...

Sass: Overcoming the challenge of the IE limitation on 4095 selectors per stylesheet

Hey there! Are you working on a Rails project with Sass & Compass? If you're using the Rails Asset Pipeline, check out this question. We're in the process of developing a large application with multiple use cases and various individually styled ...

Challenges with personalized music player

<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <style type="text/CSS"> #custom{ font-family: monospace; font-size: 16px; max-width: 650px; ...

Currently, I am working on a project and encountering an issue with html2canvas

const handleDownloadImage = async () => { try { const canvas = await html2canvas(cardRef.current); console.log(cardRef.current); const imageData = canvas.toDataURL("image/png"); setImageUrl(imageData); } catch ( ...

Why is the official website for the Apache HTTP Server httpd.apache.org when HTTPd is actually a program that can be run?

After conducting thorough research, I discovered that HTTPd (HyperText Transfer Protocol daemon) is a software program that operates in the background of a web server. My amazement and confusion peaked when I came across the webpage 'httpd.apache.org ...

Adjusting the dimensions of the canvas leads to a loss of sharpness

When I click to change the size of the graph for a better view of my data in the PDF, the canvas element becomes blurry and fuzzy. Even though I am using $('canvas').css("width","811"); to resize the canvas, it still results in a blurry graph. I ...