0

This will be lot's of typing involved.

I've got a page I need to slightly change design when the size is decreased. Including but not limited to some parts of menus swapping places and extra design features on some fields

At the moment I am trying to strictly stick to Bootstrap 4 documentation on responsive breakpoints (https://getbootstrap.com/docs/4.0/layout/overview/)

Just giving an example of one of the menus

<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <title>Navigation Menu</title>
    
    <script src="Libs/JQuery/jquery-3.3.1.slim.min.js"></script>
    <script>window.jQuery || document.write('<script src="Libs/JQuery/jquery-3.3.1.slim.min.js"><\/script>')</script>
    <script src="Libs/Popper/popper.min.js"></script>
    <script src="Libs/Bootstrap/js/bootstrap.bundle.js"></script>
    
    <link rel="stylesheet" type="text/css" href="Libs/Bootstrap/css/bootstrap.css" media="all">
    <link rel="stylesheet" type="text/css" href="Css/TopMenu.css" media="all">
    
</head>
    
<body>

<nav class="navbar navbar-expand-lg navbar-light bg-light" id="top-menu">

    <a class="navbar-brand" href="#"><img src="Images/logo.png" alt="Logo">
        <!-- Carousel -->
    </a>

    <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#main-navbar" aria-controls="main-navbar" aria-expanded="false" aria-label="Toggle navigation">
        <span class="navbar-toggler-icon"></span>
    </button>

    <div class="collapse navbar-collapse main-navbar" id="main-navbar">

        <ul class="nav navbar-nav mr-auto navbar-one" id="navbar-one">
            <li class="nav-item">
                <a class="nav-link" href="#">PRODUKTE</a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="#">DIENSTLEISTUNGEN</a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="#">UNTERNEHMEN</a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="#">NEWSROOM-STORY</a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="#">SPOTLIGHT:TECHNIK
                    <?php //echo $spotlight; ?>
                </a>
            </li>
        </ul>
        
        <ul class="nav navbar-nav smaller_font mr-auto navbar-two" id="navbar-two">
            <li class="nav-item">
                <a class="nav-link text-danger" href="#">KUNDEN-COCKPIT</a>
            </li>
            <li class="nav-itemv">
                <a class="nav-link text-danger" href="#">SHOP</a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="#">DATENSCHUTZ</a>
            </li>
            <li class="nav-itemv">
                <a class="nav-link" href="#">KONTAKT</a>
            </li>
        </ul>
        
        <!-- Language Menu -->
        <ul class="nav navbar-nav mr-auto language-menu" id="language-menu">
            <li class="nav-item">
                <a class="nav-link" href="#">DE</a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="#">EN</a>
            </li>
        </ul>

    </div>

</nav>
    
</body>
</html>

And the extra css is as follows

.smaller_font{
    font-size: 80%;
}

@include media-breakpoint-down(md){
    .main-navbar{
        border-bottom: solid 1px;
    }
}

At the moment I am trying to use @include media-breakpoint-down(md){...} But I get no reaction from the design which does absolutely NOTHING when I decrease the size.

The idea is that the fields in the menu are going to have 1px bottom border.

I know that there's also an option of making invisible elements and then making them visible as discussed here bootstrap 4 responsive utilities visible / hidden xs sm lg not working

or setting width in pixels with "@media" tag but using "@include media-breakpoint-down()" tag seems to make more sense overall (just a gut feeling).

I need someway to get things to work on small scale, so that I can build from there :-)

2 Answers2

1

"At the moment I am trying to use @include media-breakpoint-down(md){...} But I get no reaction from the design which does absolutely NOTHING when I decrease the size."

This isn't CSS...

@include media-breakpoint-down(md){
    .main-navbar{
        border-bottom: solid 1px;
    }
}

It's SASS. SASS is "compiled" into CSS server-side using a SASS processor. The browser doesn't understand SASS, it only understands CSS.

Carol Skelly
  • 351,302
  • 90
  • 710
  • 624
-1

Some good info found here so decided to go with imperfect, but still good solution of creating invisible object in your code.