Topic: FULL PAGE INTRO WITH FIXED NAVBAR not displaying correctly

Yasin at Loyal Loops pro asked 6 years ago


hello, Im trying to use FULL PAGE INTRO WITH FIXED NAVBAR and copied the code into my html and copied the css into style.css here is a screenshot of what im getting: https://drive.google.com/file/d/0Bxoty4CDYZQ_NVVCXzdTMHFRYTA/view?usp=sharing here is my index.html `<!DOCTYPE html> <html lang="en"> <head> <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"> <title>Material Design Bootstrap</title> <!-- Font Awesome --> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.0/css/font-awesome.min.css"> <!-- Bootstrap core CSS --> <link href="css/bootstrap.min.css" rel="stylesheet"> <!-- Material Design Bootstrap --> <link href="css/mdb.min.css" rel="stylesheet"> <!-- Your custom styles (optional) --> <link href="css/style.css" rel="stylesheet"> </head> <body> <!--Navigation & Intro--> <header> <nav class="navbar navbar-toggleable-md navbar-dark mdb-color lighten-3"> <div class="container"> <button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation"> <span class="navbar-toggler-icon"></span> </button> <a class="navbar-brand" href="#"> <img src="http://mdbootstrap.com/img/logo/mdb-transparent-sm-shadows.png" class="d-inline-block align-top" alt="MDBootstrap"> </a> <div class="collapse navbar-collapse" id="navbarNav"> <ul class="navbar-nav mr-auto"> <li class="nav-item active"> <a class="nav-link">Home <span class="sr-only">(current)</span></a> </li> <li class="nav-item"> <a class="nav-link">Features</a> </li> <li class="nav-item"> <a class="nav-link">Pricing</a> </li> <li class="nav-item btn-group"> <a class="nav-link dropdown-toggle" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Dropdown</a> <div class="dropdown-menu" aria-labelledby="dropdownMenu1"> <a class="dropdown-item">Action</a> <a class="dropdown-item">Another action</a> <a class="dropdown-item">Something else here</a> </div> </li> </ul> <ul class="navbar-nav nav-flex-icons"> <li class="nav-item"> <a class="nav-link"><i class="fa fa-facebook"></i></a> </li> <li class="nav-item"> <a class="nav-link"><i class="fa fa-twitter"></i></a> </li> <li class="nav-item"> <a class="nav-link"><i class="fa fa-instagram"></i></a> </li> </ul> </div> </div> </nav> <!--Mask--> <div class="view hm-black-strong"> <div class="full-bg-img flex-center"> <div class="container"> <div class="white-text text-center wow fadeInUp"> <h2>This Navbar isn't fixed</h2> <h5>When you scroll down it will disappear</h5> <br> <p>Full page intro with background image will be always displayed in full screen mode, regardless of device </p> </div> </div> </div> </div> <!--/.Mask--> </header> <!--Navigation & Intro--> <!--Main layout--> <main class="pt-6 text-center"> <h2>Your content</h2> </main> <!--/Main layout--> <!-- SCRIPTS --> <!-- JQuery --> <script type="text/javascript" src="js/jquery-3.1.1.min.js"></script> <!-- Bootstrap tooltips --> <script type="text/javascript" src="js/tether.min.js"></script> <!-- Bootstrap core JavaScript --> <script type="text/javascript" src="js/bootstrap.min.js"></script> <!-- MDB core JavaScript --> <script type="text/javascript" src="js/mdb.min.js"></script> </body> </html>


and here is my style.css 
html, body, header, .view { height: 100%; } /* Navigation*/ .navbar { background-color: #4285F4; } /*Intro*/ .view { background: url("https://mdbootstrap.com/img/Photos/Horizontal/Nature/12-col/img%20(54).jpg")no-repeat center center fixed; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover; } ` do you guys know what im doing wrong? i have the pro version.

Marta Wierzbicka staff answered 6 years ago


Hi Kushal Kant, send me your index.html file with the code to m.szymanska@mdbootstrap.com, please. I'll help you. Best, Marta

Marta Wierzbicka staff answered 6 years ago


Hi Yasin, Look at this code below. I've fixed your code you pasted here a little and maybe this is the effect you expect. But anyway we'll fix all our page layouts in next update of MDB which will be very soon.
<!DOCTYPE html>
<html lang="en" class="full-height">
<head>
    <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">
    <title>Material Design Bootstrap</title>
    <!--Font Awesome -->
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.0/css/font-awesome.min.css">
    <!--Bootstrap core CSS -->
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <!--Material Design Bootstrap -->
    <link href="css/mdb.min.css" rel="stylesheet">
    <!--Your custom styles (optional) -->
    <link href="css/style.css" rel="stylesheet">

    <style type="text/css">
    .full-height,
    .full-height body,
    .full-height header,
    .full-height header .view {
      height: 100%; }

    /*Intro*/
    
    .view {
            background: url("https://mdbootstrap.com/img/Photos/Others/img (50).jpg")no-repeat center center;
            background-size: cover;
        }
    </style>
</head>

<body class="mdb-skin">
    <header>
        <nav class="navbar fixed-top navbar-toggleable-md navbar-dark scrolling-navbar">
            <div class="container">
                <button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
                    <span class="navbar-toggler-icon"></span>
                </button>
                <a class="navbar-brand" href="#">
                    <strong>Navbar</strong>
                </a>
                <div class="collapse navbar-collapse" id="navbarNav">
                    <ul class="navbar-nav mr-auto">
                        <li class="nav-item active">
                            <a class="nav-link">Home <span class="sr-only">(current)</span></a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link">Features</a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link">Pricing</a>
                        </li>
                        <li class="nav-item btn-group">
                            <a class="nav-link dropdown-toggle" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Dropdown</a>
                            <div class="dropdown-menu" aria-labelledby="dropdownMenu1">
                                <a class="dropdown-item">Action</a>
                                <a class="dropdown-item">Another action</a>
                                <a class="dropdown-item">Something else here</a>
                            </div>
                        </li>
                    </ul>
                    <ul class="navbar-nav nav-flex-icons">
                        <li class="nav-item">
                            <a class="nav-link"><i class="fa fa-facebook"></i></a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link"><i class="fa fa-twitter"></i></a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link"><i class="fa fa-instagram"></i></a>
                        </li>
                    </ul>
                </div>
            </div>
        </nav>
        <!--Mask-->
        <div class="view hm-black-strong">
            <div class="full-bg-img flex-center">
                <div class="container">
                    <div class="white-text text-center wow fadeInUp">
                        <h2>This Navbar is fixed</h2>
                        <h5>It will always stay visible on the top, even when you scroll down</h5>
                        <br>
                        <p>Full page intro with background image will be always displayed in full screen mode, regardless of device </p>
                    </div>
                </div>
            </div>
        </div>
        <!--/.Mask-->
    </header>
    <!--Main layout-->
    <main class="pt-6 text-center">
        <h2>Your content</h2>
    </main>
    <!--/Main layout-->

    <!--SCRIPTS -->
    <!--JQuery -->
    <script type="text/javascript" src="js/jquery-3.1.1.min.js"></script>
    <!--Bootstrap tooltips -->
    <script type="text/javascript" src="js/tether.min.js"></script>
    <!--Bootstrap core JavaScript -->
    <script type="text/javascript" src="js/bootstrap.min.js"></script>
    <!--MDB core JavaScript -->
    <script type="text/javascript" src="js/mdb.min.js"></script>
</body>
</html>
Best, Marta

KUSHAL KANT free commented 6 years ago

I am using this one when I am scrolling 'top-nav-collapse' not adding like as giving example. https://mdbootstrap.com/live/_MDB/index/docs/page-layouts/intro-fixed-transparent.html

xardonik free answered 6 years ago


Hi, do you have problem with small space from right and left or what?

Hi guys, I was expecting it to look like this: https://mdbootstrap.com/live/_MDB/4.3.2/docs/page-layouts/intro-fixed-color.html but was getting the result shown in the screenshot i linked to in my original message. It's mainly a styling issue, I thought I was doing something wrong and having something in the css interfere...

Yasin, could you please tell us what's wrong?

xardonik free answered 6 years ago


Hi, what is wrong?

Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue

  • ForumUser: Pro
  • Premium support: No
  • Technology: General Bootstrap questions
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: No
  • Provided link: No