A guide to integrating forms on top of a background image and alongside a navigation bar

My main challenge is my limited knowledge of Bootstrap/CSS, which has led me to piece together code from different sources and tweak it to fit my needs. Another issue I'm facing is the correct nesting of containers/rows/columns around my navbar (which I want fixed to the left) and on top of a background image in a mobile web application setting. Specifically, I aim to display forms on top of this background image.

I've spent nearly two full days experimenting with inserting containers, rows, and columns around my existing code without success. Instead of achieving the desired layout, my navbar shifts to the center and text either appears above or below the image, but not on top of it. The background image is defined in the CSS within the head section as shown below.

body,
html {
  height: 100%;
  margin: 0;
}

.bg {
  background: url("Red_polygon.jpg");
  height: 100%;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.navbar-custom {
  background-color: rgba(22, 22, 22, 1)
}

.thumbnail {
  float: left;
  margin: 2px 0px 2px 2px;
  background: transparent;
  border: 0 none;
  box-shadow: none;
}
<nav class="navbar navbar-custom navbar-fixed-top">
  <div class="thumbnail" border="0">
    <img src="ASD_header_logo.png" alt="Active Software Development" width=277 height=76 />
  </div>
</nav>

<body>
  <nav class="navbar navbar-custom navbar-fixed-top">
    <div class="thumbnail" border="0">
      <img src="ASD_header_logo.png" alt="Active Software Development" width=277 height=76 />
    </div>
  </nav>


  <div class="bg">
    <div class="wrapper">
    </div>
    <nav id="sidebar">
      <ul class="list-unstyled components">
        <p>
          <center>
            <h4>Management Information System</h4>
          </center>
        </p>
        <li>
          <a href="#pageSubmenu" data-toggle="collapse" aria-expanded="false" class="dropdown-toggle">Project nav</a>
          <ul class="collapse list-unstyled" id="pageSubmenu">
            <li>
              <a href="#">Projects</a>
            </li>
            <li>
              <a href="#">Activities</a>
            </li>
            <li>
              <a href="#">Tasks</a>
            </li>
            <li>
              <a href="#">Staff</a>
            </li>
          </ul>
        </li>
        <li>
          <a href="#">Help</a>
        </li>
        <li>
          <a href="#">Contact</a>
        </li>
      </ul>
      <ul class="list-unstyled components">
        <li>
          <a href="#">Home</a>
        </li>
        <li>
          <a href="#">Logout</a>
        </li>
      </ul>
    </nav>
  </div>

I suspect there are errors in how I structured the navbar and background image. I am seeking assistance to understand my mistakes and learn how to rectify them. Apologies for the lengthy code snippet, as I'm unsure of what’s relevant after trying various approaches. Thank you for your help and warm regards.

Answer №1

I have implemented a basic framework to include the elements you mentioned earlier. However, I am unsure about the specific purpose of the code provided. Let's discuss further if you require additional assistance.

body,
html {
  height: 100%;
  margin: 0;
}

.bg {
  background: url("https://www.publicdomainpictures.net/pictures/130000/velka/abstract-magical-background.jpg");
  height: 100%;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.navbar-custom {
  background-color: rgba(22, 22, 22, 1)
}

.thumbnail {
  float: left;
  margin: 2px 0px 2px 2px;
  background: transparent;
  border: 0 none;
  box-shadow: none;
}
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">

<body class="">
  <nav class="navbar navbar-custom navbar-fixed-top">
    <div class="thumbnail" border="0">
      <img src="ASD_header_logo.png" alt="Active Software Development" width=277 height=76 />
    </div>
  </nav>

    <div class="container-fluid">
      <div class="row">
        <div class="col-2">
         <nav id="sidebar">
        <ul class="list-unstyled components">
          <p>
            <center>
              <h4>Management Information System</h4>
            </center>
          </p>
          <li>
            <a href="#pageSubmenu" data-toggle="collapse" aria-expanded="false" class="dropdown-toggle">Project nav</a>
            <ul class="collapse list-unstyled" id="pageSubmenu">
              <li>
                <a href="#">Projects</a>
              </li>
              <li>
                <a href="#">Activities</a>
              </li>
              <li>
                <a href="#">Tasks</a>
              </li>
              <li>
                <a href="#">Staff</a>
              </li>
            </ul>
          </li>
          <li>
            <a href="#">Help</a>
          </li>
          <li>
            <a href="#">Contact</a>
          </li>
        </ul>
        <ul class="list-unstyled components">
          <li>
            <a href="#">Home</a>
          </li>
          <li>
            <a href="#">Logout</a>
          </li>
        </ul>
      </nav>
        </div>
        <div class="col-10">
        <div class="bg">
        <form class="text-white">
  <div class="form-group">
    <label for="exampleInputEmail1">Email address</label>
    <input type="email" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp" placeholder="Enter email">
    <small id="emailHelp" class="form-text text-muted">We'll never share your email with anyone else.</small>
  </div>
  <div class="form-group">
    <label for="exampleInputPassword1">Password</label>
    <input type="password" class="form-control" id="exampleInputPassword1" placeholder="Password">
  </div>
  <div class="form-group form-check">
    <input type="checkbox" class="form-check-input" id="exampleCheck1">
    <label class="form-check-label" for="exampleCheck1">Check me out</label>
  </div>
  <button type="submit" class="btn btn-primary">Submit</button>
</form>
        </div>
        </div>
      </div>
     
    </div>
  </body>

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

CSS selectors can be used to alter the styling of the container surrounding the text

My current content includes: <span> Hello </span> I am looking to apply CSS selectors to either replace or enclose the text inside the element with an <h1> Is it doable using only CSS selectors? ...

Do the values returned by window.screen.width and height represent CSS pixels or physical screen pixels?

After exploring the API named screen and visiting this documentation link, my initial anticipation was that I would receive information regarding actual screen size pixels. https://developer.mozilla.org/en-US/docs/Web/API/Screen/width https://i.sstatic.n ...

Ensure that all elements are consistently kept within a DIV container

In my experience with web development, one recurring challenge is ensuring that everything stays contained within a div element. I often encounter situations where multiple nested divs and content cause styling nightmares when elements bleed out of their d ...

What is the proper method for changing the height of this component in HTML?

Hey there! I'm brand new to HTML and I'm embarking on a little project for myself to enhance my skills. I have a question about adjusting the height of some text - I want it to look similar to Twitter, where each "tweet" is clearly separated from ...

Creating tabbed content with a classless CSS design by utilizing radio buttons instead of the traditional unordered

I am attempting to transform the classless CSS and HTML provided below from a list format to using radio buttons and labels for tabbed content. My goal is to make it concise and avoid redundancy. Here is the setup of what I am aiming for: <nav> ...

Ensuring Your IMG is Perfectly Centered in DIV Across all Browsers

I have tried all the tips from the top Google results, but I am still struggling to center an image within a div. For example, the popular tricks mentioned in this link: or http://www.w3.org/Style/Examples/007/center.en.html do not seem to work in IE 8. ...

CSS3 Marquee Effect - puzzled

After trying numerous solutions for the marquee effect, I find myself at a dead end. Even webkit examples have failed me, as the demos don't seem to work either. My browser of choice is Chrome, but my website needs to function properly in both Chrome ...

The javascript code appears to be functioning properly on desktop browsers but is not functioning as expected on Chrome's mobile browser

On my WordPress site, I have created a Java Bootstrap loan calculator that works perfectly on desktop. However, when I use Chrome on mobile, it is not functioning properly. I tried using the wp-coder plugin and also manually added the necessary code. Int ...

Converting CSS colors from RGBA to hexadecimal format: A step-by-step guide

Within my selenium code, I am faced with the challenge of verifying that the background color code is #192856. However, when obtaining the CSS property of the element, it returns the color in rgba format. How can I retrieve the values in hex format? quick ...

When utilizing pseudo element ::before and display:table-cell in IE11, the glyphicons content may not appear as expected

I've been working on this for a while now, but I can't seem to find a solution. The issue I'm facing is that I want to display a glyphicon before the content of a text-block, and I need that element with the icon to fill up all the height th ...

Having difficulty adding a Dropdown Menu in a Pop-up Box

I am trying to incorporate a select menu inside of a popover, but every time I attempt to do so, the popover content block remains blank. The popover is associated with a side menu item called "Date History". Below is the code snippet I am using to constr ...

Changing the Style of a CSS Module Using JavaScript

Embarking on a journey into Javascript and React, I am currently working on my first React app. My aim is to adjust the number of "gridTemplateRows" displayed on the screen using a variable that will be updated based on data. Right now, it's hardcode ...

Tips on controlling the color of an input field in a form using React

Within my React app, there is a text input field situated inside a form that displays in its default gray color before any interaction: https://i.stack.imgur.com/FdNos.png Once the input field is clicked on, it changes to white as shown here: https://i.s ...

The button functionality gets hindered within the Bootstrap well

I'm trying to figure out what's wrong with my code. Here is the code: https://jsfiddle.net/8rhscamn/ <div class="well"> <div class="row text-center"> <div class="col-sm-1">& ...

What causes top margins to collapse while bottom margins remain intact?

Upon examining the demonstration below, it is evident that in the left-column, the top padding edge of .clearfix-using_display-table (the yellow section) and .clearfix-using_display-table p (the silver part) are touching. However, on the lower edge, for so ...

Looking for assistance with CSS border animation

Below is my code snippet: .section-one { position: relative; background: #ffffff; } .section-one h2 { color: #000000; font-size: 32px; margin: 0px 0px 10px 0px; padding: 0px; font-family: "AzoSans-Medium"; } ... /* ...

Determining the exact position of an absolute element within a Bootstrap container

In my design, I am using a full-width cover image with a bootstrap container class containing an absolutely positioned image on top of the cover image. My goal is to have this image positioned exclusively on the right-hand side of the container. Below is ...

Position the background of the container in the center and keep it

I am trying to create a fixed background header using the following CSS properties: header { margin: 0; padding: 0; width: 100%; height: 300px; display: block; background-image: url('...'); background-repeat: no-repea ...

Align navigation items in the center of the navigation container

I've been grappling with aligning the content of a nav-item inside a nav container in my project. I'm unable to apply a margin on the ul>li items as it doesn't adjust properly on different resolutions. I've tried using percentages, b ...

Is it possible to specify at what point the bootstrap dropdown should convert to a dropup instead?

I have noticed that the bootstrap 4 dropdown transitions to a dropup when there is not enough space at the bottom of the browser window. Is there a way to modify this behavior so that it changes to a dropup when it's, for example, 150px away from the ...