The input group becomes lodged under the navigation bar

I am having an issue where my Input group is getting stuck behind the navbar and I can't seem to figure out how to fix it. I have tried putting containers around both elements, but that doesn't seem to be working. If anyone has any suggestions or solutions for this issue, I would greatly appreciate the help. Additionally, if you also have insights on why my navbar won't collapse, your assistance would be invaluable.

.navbar-inverse {
    background-color: #403F3F;
    border-color: #E7E7E7;
    border-bottom-width: 7px;
}
.navbar-inverse .navbar-nav > .active a{
    background: #E7E7E7;
 }
.navbar-inverse .navbar-nav > .active > a, 
.navbar-inverse .navbar-nav > .active > a:hover, 
.navbar-inverse .navbar-nav > .active > a:focus {
    background: #E7E7E7;
    color: #403F3F;
}
#bg {
  position: fixed; 
  top: -50%; 
  left: -50%; 
  width: 200%; 
  height: 200%;
}
#bg img {
  position: absolute; 
  top: 0; 
  left: 0; 
  right: 0; 
  bottom: 0; 
  margin: auto; 
  min-width: 50%;
  min-height: 50%;
  -webkit-filter: blur(3px);
}
a {
    font: 300 1em/1.5em 'Lato';
    font: Light 300 1em/1.5em 'Lato';
    font: Light 300 1em/1.5em 'Lato', sans-serif;
    color: white;
}
a {
    color:white;
    -o-transition:color .2s ease-out, background 2s ease-in;
    -ms-transition:color .2s ease-out, background 2s ease-in;
    -moz-transition:color .2s ease-out, background 2s ease-in;
    -webkit-transition:color .2s ease-out, background 2s ease-in;
    transition:color .2s ease-out, background 2s ease-in;
}
a:hover { 
    color:cyan;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"/>
<link href='https://fonts.googleapis.com/css?family=Roboto+Condensed:300,300italic' rel='stylesheet' type='text/css'>
<link href='https://fonts.googleapis.com/css?family=Lato:100,300,400,300italic' rel='stylesheet' type='text/css'>
<body>
    <!-- NAVBAR START -->
<div class="container">
    <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
        <div class="container-fluid">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=".navbar-collapse">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="#">
                <img alt="Brand" width="48" style="margin-top:-13px; margin-left:0px;" src="http://vps52525.vps.ovh.ca/assets/img/bar-logo.png"></a>
            </div>
            <div class="navbar-collapse collapse">
                <ul class="nav navbar-nav list-hover-slide">
                    <li class="active"><a href="#">&nbsp;Backpack</a>
                    </li>
                    <li><a href="#">&nbsp;Price Checker</a>
                    </li>
                </ul>
                <ul class="nav navbar-nav navbar-right list-hover-slide">
                    <li><a href="#">&nbsp;FAQ</a>
                    </li>
                    <li><a href="#">&nbsp;Partners</a>
                    </li>
                    <li><a href="#">&nbsp;Donate</a>
                    </li>
                </ul>
            </div>
        </div>
    </nav>
</div>
<!-- NAVBAR END -->
<div id="bg">
  <img src="http://vps52525.vps.ovh.ca/assets/img/bk.png" alt="Broken i guess....">
</div>
<div class="input-group">
  <span class="input-group-addon" id="basic-addon1">@</span>
  <input type="text" class="form-control" placeholder="Username" aria-describedby="basic-addon1">
</div

Answer №1

The issue with the input-group appearing below the navbar is caused by the presence of a class called navbar-fixed-top on the navbar, which fixes its position. To resolve this, simply add a margin-top of 51px to the input-group.

This can be achieved by adding:

margin-top: 51px;

I chose 51px as the value because that is the height of your navbar. Refer to the image link below for clarification:

https://i.sstatic.net/TH0mW.png

It is recommended to assign a specific class to the input-group and apply the margin-top property to that particular class.

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

AngularJS - displaying a notification when the array length is empty and customizing the visibility to conceal the default action

I've been working on an Angular project where I display a loading circle that disappears once the content is loaded. This circle is simply a CSS class that I call from my HTML only when the page first loads, like this: Actually, the circle consists o ...

The layout of the HTML code will vary depending on whether the page is viewed in full

My webpage built with aspx has a layout that changes when the window is restored: I'm trying to prevent this layout shift from happening. Here's my code snippet: <%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup= ...

The dropdown list in angularjs is failing to populate with options

For populating a dropdownlist using angularjs, I attempted the following: var app = angular.module('App', []); app.controller('UserSelection', function ($scope, $location) { var User = this; User.onSelectChange = function () { i ...

Steer clear of wrapping ng-repeat in nested indexes for routing purposes

I am currently working on an Angular application that displays data in 3 item columns using Bootstrap. To achieve this layout, I have implemented the following code snippet to group my array of data into sets of 3: examples.success(function(data) { $sc ...

Differentiating the appearance of an HTML datalist with color alterations

Is there a way to customize the color of the datalist element (black box shown in the image)? https://i.stack.imgur.com/GGJQ3.png https://www.w3schools.com/tags/tryit.asp?filename=tryhtml5_datalist EDIT: The default color is set by the system, although ...

I am encountering an issue where the characters "£" is displaying as "£" when my HTML is rendered. Can anyone explain why this is happening?

Here is the code I'm having trouble with: http://pastebin.com/QBLeLyNq. For some reason, the "code" part isn't working correctly. Any help would be appreciated. I used to run a small business and had a profit of £145 with an investment of only ...

Updating CSS property names with jQuery: A step-by-step guide

My issue involves a div with inline style "left: Random Number". I have attempted to use various CSS change functions, but none have been successful. The problem lies in the fact that the property of left is random, and I am trying to change it to right. ...

"Combining the powers of Ajax, jQuery, and PHP

I have developed a jQuery form that looks like this <div data-role="page" id="page3" data-theme="d" > <div data-role="header"> <h1 style="font-family: 'Open Sans Condensed', sans-serif;font- size:23px">LetsAllSave</h1> ...

jQuery - translating and organizing names of countries

I have implemented a jQuery function to organize a list of country names based on the user's selected language code (via a language select dropdown). You can find more information on this topic in this related post. The translation of country names s ...

Is there a way to customize the background in a complimentary bootstrap template?

This code snippet utilizes Bootstrap CSS to set a background image. background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40&apos ...

Improving the performance of a graphics card-intensive animation frame

With appreciation to @Temani Afif, we were able to implement this stunning frame. Despite the code operating smoothly, an issue has arisen that renders the code ineffective. A staggering 90 percent of my GPU resources are being utilized! Within just 10 se ...

Utilize PHP to import an HTML file with JavaScript code into MySQL database

I've been attempting to use JavaScript to retrieve my location, but I'm facing an issue where when I click submit, the data is not getting entered into the page action.php. geolocation.php <form action="action.php" method="post"> < ...

Please ensure you have selected at least one item before submitting the form

I have been working on validating a form using a combination of bootstrap and angularjs. The form includes two groups of checkboxes that need to be validated. It is required for the user to select at least one checkbox from each group in order for the Subm ...

Combining multiple PNG images onto a base image in PHP

I need assistance in merging 24 images with single dashes highlighted into a base circle image using PHP GD, JS or CSS. All images are in PNG format. Your help would be greatly appreciated. ...

Challenges Faced when Connecting JavaScript to HTML

This is a snippet of my HTML where I link the .js file <!DOCTYPE html> <html> <head> <link rel="stylesheet" type="text/css" href="CSS/Style.css"> <title> Learning JavaScript </title& ...

Develop a Greasemonkey userscript that eliminates specific HTML lines upon detection

I am attempting to create a Grease Monkey script that can eliminate specific lines in HTML code. For example, consider the following: <ul class="actionList" id="actionList" style="height: 158px;"> <li class="actionListItem minion minion-0 fi ...

JavaScript code to read a .txt file

Is it possible to use JavaScript to read a text file directly with the file path provided in the code, rather than selecting the file from an open file window? ...

Utilizing Jquery for draggable/droppable functionality in combination with custom overflow styles

Encountering a challenge with a drag and drop system that utilizes CSS overflow properties to enable vertical scrolling of a list of values. The issue arises when dragging an item between selected and unselected areas, causing the dragged item to disappear ...

What could be causing the issue with Hindi text not displaying properly on Safari?

I'm having trouble with displaying Hindi text on my website. I tried pasting the text in a new file and it worked, so why is it not loading correctly in this case? The Hindi script is within the second span with the class word w2. "use strict"; le ...

Containers situated at the core

Seeking assistance with centering two containers horizontally on the site. Specifically, I would like the menu with the logo on the right side and the content block to be centered. Despite trying various methods, nothing seems to work for me. Previously, I ...