Shifting Divs/Text while adjusting zoom levels in HTML/CSS with Bootstrap

As a newcomer to the coding world, I am encountering an issue with my Navbar. Everything appears fine at 100% zoom on the browser, but when I zoom in to 150%, everything becomes jumbled. How can I ensure that everything stays the same size regardless of zoom level? Thank you for your assistance.

ZOOM WITH 100%

ZOOM WITH 150%

ZOOM WITH 200%

* {
    margin: 0;
    padding: 0;
}


.pre-header {
    background-color: #111618;
    height: 60px;
    color: #fff;
    padding-top: 15px;

}

.pre-header .secondary-menu {
    list-style: none;
}

.pre-header .secondary-menu li {
    display: inline-block;
    margin-left: 15px;
}

.pre-header .secondary-menu li a {
    color: #787374;
    text-transform: uppercase;
}

.main-nav .main-menu {
    list-style: none;
    margin-top: 15px;
}

.main-nav .main-menu li {
    display: inline-block;
    margin: 10px;
}

.main-nav .main-menu li a {
    color: #767676;
    text-transform: uppercase;
}

.main-nav img {
    margin-top: 10px;
}

.main-nav .main-menu .free-quote-btn a {

}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="e88a87879c9b9c9a8998a8dcc6ddc6db">[email protected]</a>/dist/css/bootstrap.min.css" integrity="sha384-TX8t27EcRE3e/ihU7zmQxVncDAy5uIKz4rEkgIXeMed4M0jlfIDPvg6uqKI2xXr2" crossorigin="anonymous">
    <link rel="stylesheet" href="probaferomotosajta.css">
    <title>Feromoto - Hidraulicna creva</title>
</head>
<body>
<header>
    <div class="pre-header">
        <div class="container">
            <div class="row">
                <div class="col-md-6">
                    <p>UNDER ATTACK? - S.O.S LINE 880.000.800</p>
                </div>
                <div class="col-md-6">                  
                    <ul class="secondary-menu">
                        <li><a href="#">Login</a></li>
                        <li><a href="#">Contacts</a></li>
                        <li><a href="#">Presale Service</a></li>
                        <li><a href="#">Whitepapers</a></li>
                    </ul>  
                </div>
            </div>
        </div>
    </div>

    
    <div class="main-nav">
        <div class="container">
            <div class="row">
                <div class="col-md-4">
                    <img src="slika1.png" width="120" height="120" alt="">
                </div>
                <div class="col-md-8">
                    <ul class="main-menu">
                        <li><a href="#">Home</a></li>
                        <li><a href="#">News</a></li>
                        <li><a href="#">Blog</a></li>
                        <li><a href="#">Shop</a></li>
                        <li><a href="#">Courses</a></li>
                        <li><a href="#">Rating</a></li>
                        <li><a href="#">Team</a></li>
                        <li><a href="#">Job</a></li>
                        <li class="free-quote-btn"><a href="#">Free Quote</a></li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
</header>
<script src="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="1d7f7272696e696f7c6d5d293328332e">[email protected]</a>/dist/js/bootstrap.bundle.min.js" integrity="sha384-ho+j7jyWK8fNQe+A12Hb8AhRq26LrZ/JpcUGGOn+Y7RsweNrtN/tE3MoK7ZeZDyx" crossorigin="anonymous"></script>    
</body>
</html>

Answer №1

The reason for this issue might be due to the reduction in window width when zooming in your browser. One way to resolve it is by implementing a @media query.

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

Is there a way in Angular2 to append a class name from a variable to the host element without removing the current classes?

I am facing a challenge where I have a class name stored in a variable and I need to apply it to the host element of my Angular2 component. However, I am struggling to find a solution for this. While I can easily add a constant string as a class using Hos ...

The CSS code functions properly in Firefox, however, it does not seem to be functioning in

The menu I created in Magento is functioning correctly in Firefox. When I hover over the menu in Firefox, it works fine, but I am not seeing any hover effects in Chrome. Here is how my hover style is defined: #nav { width:965px; margin ...

Press the button to access the URL within the current window

Working with Angular, I attempted to develop a function to open a URL in the current window. However, the code below within the controller actually opens a new window: $scope.openUrl = function(url) { $window.open(url); }; ...when using ng-click=&apo ...

Struggling to get the max-width property to function properly with a Bootstrap multi-level dropdown menu

I have a multi-level Bootstrap dropdown menu that I am customizing based on the design featured in this bootsnipp. However, I am encountering an issue where some of my menu items are too lengthy, so I need to restrict their width to a maximum of 400px. Ad ...

Is it possible to align the navigation within the Bootstrap (5) grid structure like I have shown in my example?

Can this be achieved? Any tips on how to do it while sticking within the Bootstrap framework would be greatly appreciated. Text blocks should align with the navigation border on the left and right side: <link rel="stylesheet" href="https://cdn.jsd ...

What is the best way to align my progress bar to the bottom of a button?

I've encountered a small issue that I'm struggling to resolve. My goal is to create a button with a Bootstrap progress bar at the bottom, but I can't seem to make it work as intended. Here's the current setup: https://jsfiddle.net/bob ...

Try utilizing the 'id name ends with' parameter within the on() function for creating dynamic bindings

I need help with dynamically binding the change event to multiple select input fields that are generated within my form. The item field is generated with IDs like: id="id_form-0-item" id="id_form-1-item" id="id_form-2-item" ... Although I have attempte ...

Nav bar width remains stagnant despite varying content lengths

My navigation bar looks great with 5 objects, but as soon as I add 3 more, it suddenly drops below the main header. Why is this happening? 5 Objects: 7 Objects: HTML: <div id="header"> <div class="w960"> <div id="logo"> ...

Issues with Node JS app's handling of php mailer code

I've made a basic website using the Node JS framework and included a php mailer for handling the contact form. Unfortunately, I'm facing issues getting it to function properly. Could it be possible that there is an underlying problem with Node JS ...

Displaying an HTML file in a Node and Express application using JavaScript File handling

Starting my first Node, Express & Angular project has been a bit tricky due to issues with the asset pipeline. I'm not entirely sure if it's related to my folder structure, which I tried setting up based on online tutorials but am open to suggest ...

Learning to retrieve specific properties from an event target in JavaScript

Here is the code snippet I am working with: <h1 msgId = "someId"> Some text </h1> And in my code.js file, I have the following function: document.addEventListener('click', function(e) { target = e.target; }, false); I am tryin ...

react: implement custom context menu on videojs

Can someone assist me with adding a quality selector and disabling the right-click option in a webpage that uses videojs? I am unsure about using plugins, as there were no examples provided in react. Any guidance would be appreciated. VideoPlayer.js impor ...

The correct functioning of CSS hyperlinks is currently experiencing issues

The links in the "request" division are not displaying properly. The style.css file contains the following code for the links in this division: .header .request a span{border-bottom:1px dotted}.header .request a:hover span{border-bottom:0} Example: berdy ...

Utilizing Angular 9's inherent Ng directives to validate input components within child elements

In my current setup, I have a text control input component that serves as the input field for my form. This component is reused for various types of input data such as Name, Email, Password, etc. The component has been configured to accept properties like ...

Utilizing a range input (slider) to extract data of importance

When dynamically adding a slider to a page using a specific string, like the one shown below: "<input type=\"range\" name=\"aName\" min=\"1\" max=\"9\"/>"; After appending it to the page with pure JavaScript, ...

When attempting to click on the dropdown in Bootstrap, there is no content displayed

I am currently practicing Bootstrap and focusing on implementing Dropdowns. However, I am facing an issue where upon clicking the Dropdown button, nothing appears on the screen. Preview when it's not clicked Preview when it's clicked Here is m ...

Add to the end just before the final element when generating dynamically

var creatediv = document.createElement("div"); var text1 = '<input id="attribute1" type="text" placeholder="Attribute" /> $(creatediv).append(text1); var text3 = '<input id="attribute3" type="text" placeholder="Attribu ...

Why is my link not being acknowledged by its parent <div>?

I am facing an issue where a <a> tag inside a <div> element is not being recognized properly, causing the <div> height to remain unchanged and not accommodate the link as intended. You can view my HTML/CSS code here: http://jsfiddle.net/ ...

How to position multiple CSS background images effectively?

Greetings all! I'm seeking advice on how to add a background image to the right of the description and left of the first post column. Any tips on proper placement? Appreciate any help :) ...

What is the best method for efficiently wrapping contents within a div container?

On the website cjshayward.com/index_new.html, there is a div wrapped around the content of the body, which is approximately 1000 pixels wide. In Chrome and Firefox, the wrapper works perfectly for the top section of about 100 pixels. Further down the page, ...