Concerns with the alignment of Bootstrap Carousel

I need help with positioning the bootstrap carousel properly. My goal is to have the slider appear as shown in the image below.https://i.sstatic.net/vAbad.jpg

I've been struggling all day to figure out how to position my slider like the one in the image. I have two sections - first, the HEADER section and then the bootstrap slider which is currently going under my .header section. I want to push the slider up behind the .header section. Any tips or guidance would be greatly appreciated.

Here is the code I have so far:

.top-layer { background: #8bc541; padding-bottom: 25px; }

.logo-container { display: flex; justify-content: center; align-items: center; position: relative; }
.logo { position: absolute; bottom: 9px; width: 164px; height: 32px; }
.logo a { margin-bottom: 5px; display: block; height: 100%; background: url(../images/logo.png) no-repeat 0 0; font-size: 0; line-height: 0; font-style: normal; overflow: hidden; text-indent: -100%; }
.logo p { padding: 0 4px; margin-right: 2px; letter-spacing: 0.3px; cursor: pointer; text-align: center; }
.main-nav { clear: both; }
.main-nav .left-nav { list-style: none; float: left; text-align: right; padding-right: 136px; }
.main-nav .left-nav li,
.main-nav .right-nav li { display: inline-block; }
.main-nav .left-nav li a,
.main-nav .right-nav li a { font-size: 14px; font-weight: bold; color: #000; text-decoration: none; line-height: 24px; letter-spacing: 0.3px; }
.main-nav .left-nav li a:hover,
.main-nav .right-nav li a:hover { color: #fff; }
.main-nav .left-nav li + li:before,
.main-nav .right-nav li + li:before { content: ''; border-right: 2px solid #fff;  margin: 0 10px; }
.main-nav .right-nav { list-style: none; float: right; text-align: left; padding-left: 136px; }
.main-nav .left-nav li,
.main-nav .right-nav li { margin-top: 36px; }
.slider-content { position: absolute; top: 0; left: 50%; z-index: 20; }
.fill { width: 100%; height: 100%; background-position: center; -webkit-background-size: cover; -moz-background-size: cover; background-size: cover; -o-background-size: cover; } 

.bg-layer { background: url(../images/bg.jpg) 0 0 no-repeat; background-size: cover; min-height: 941px; }

.glyphicon-chevron-left { background: url(../images/btn-change.png) 0 0 no-repeat; min-width: 50px; min-height: 50px; font-size: 0; line-height: 0; font-style: normal; overflow: hidden; text-indent: -100%;  }
.glyphicon-chevron-right { background: url(../images/btn-change.png) 0 0 no-repeat; min-width: 50px; min-height: 50px; transform: rotate(180deg); font-size: 0; line-height: 0; font-style: normal; overflow: hidden; text-indent: -100%; }
.glyphicon-chevron-left:hover,
.glyphicon-chevron-right:hover { background: url(../images/btn-change-hov.png) 0 0 no-repeat; min-width: 50px; min-height: 50px; }
.carousel-control.left,
.carousel-control.right { background: none; }
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>

<header class="header">
... (omitted for conciseness)
        </ul>
          <!-- left-nav -->
        </div>
        <!-- col-md-6 -->
        ... (omitted for conciseness)
      </nav>
      <!-- main-nav -->
    ... (omitted for conciseness)
    </div>
    <!-- logo-container -->
    <div class="moto">
    ... (omitted for conciseness)
    </div>
    <!-- moto -->
  </div>
  <!-- container -->
</header>
<!-- header -->
... (omitted for conciseness)
  <a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next">
    <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
    <span class="sr-only">Next</span>
  </a>
</div>

Answer №1

Check out my simple codepen project by clicking the link below.

http://codepen.io/swapnaranjitanayak/pen/gLWEoY

In this project, I have designed a navbar with the "position:absolute" property. If you prefer it to be "fixed", simply apply the navbar-fixed-top predefined class in Bootstrap.

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

Trouble with uploading image or video files

I am facing an issue with uploading video files using an HTML form. Even though the image uploads successfully, the video file upload is not working as expected. When I try to upload a video file, it shows that it's progressing but nothing happens aft ...

Should we avoid using row or col classes in elements other than a div?

Would using row or col on elements other than a div be considered a poor practice? Perhaps using it on a span would still be acceptable, but what about elements like a or p? ...

Is there a CSS solution to center horizontally a fixed header?

My question is about centering a header made up of two div containers: #header-container and #header: #header_container { background: #eeeeee; border: 0px hidden; height: 100px; position: fixed; width: 1000px; top: 0; margin: auto; display: block; ...

Flask-WTForms QuerySelectField not displaying properly when rendered with Bootstrap causing <select> HTML tag issue

I am facing an issue while constructing a Flask form that includes a QuerySelectField. Despite having everything in place, Bootstrap is displaying the <select> as if it were a text input field. Upon inspecting the page source, I noticed that the fie ...

Position the Bootstrap button at the bottom left with absolute placement

Currently, I am utilizing Django as my web framework and Bootstrap to enhance the rendering of the frontend. My goal is to implement an "add" button on my page that will always be in the bottom left corner regardless of scrolling, overlaying any other cont ...

Tips for showing the value in the subsequent stage of a multi-step form

Assistance is required for the query below: Is there a way to display the input field value from one step to the next in multistep forms? Similar to how Microsoft login shows the email in the next step as depicted in the image below: https://i.sstatic.ne ...

Is it possible to edit multiple classes simultaneously in Bootstrap?

After creating a div with the class container and adding 50px padding to the top, I am now ready to add another container using Bootstrap's CSS. Do I need to create a new class like container-2 to edit the new container's style or are there multi ...

I am not encountering any error messages, but when I attempt to click on the form, the mouse cursor does not change to the expected form type

While there are no errors showing up in the Chrome Developers Error code, I am facing an issue with my form where the text fields are not visible. It should be a simple task, but it has turned into a headache for me. I would greatly appreciate any help i ...

Building a theme with TypeScript in React

As I embark on my React project, I've been tasked with creating a CSS using TypeScript while referring to the color palette diagram provided below. Utilizing createMuiTheme to build the theme, I've realized that there are various possible conditi ...

Struggling with adding a border to an HTML table?

I am attempting to create a table with alternating borders on the cells. After trying the code below, I still can't seem to get the desired effect. The borders are not showing up at all. Can someone provide guidance on how to achieve this? <style ...

Is there a way to modify the styling for ListItemButton specifically when it is in a selected state?

My first experience with MUI involves trying to customize the styling of a button. After installing my project with default emotion as the styling engine, I attempted to override the existing styles using the css() method mentioned in the documentation: ...

Customized Bootstrap login form aesthetic

After implementing the login with classes from bootstrap: <p class="h4 mb-4">Sign in</p> <h5 class="card-header info-color white-text text-center py-4" >Sign in</h5> I noticed that instead of having colors as shown below: https:/ ...

When refreshing the webpage, it becomes glitchy but then corrects itself

Currently working on a website, I've encountered a frustrating problem that has me scratching my head. This issue occurs across multiple pages; upon refreshing the page, the navbar, search bar, and other elements become completely disorganized. Stra ...

New ways to style Links in NextJs 13

I am relatively new to Next.js and I am attempting to create a menu with a hover effect using the following code: import Link from 'next/link'; const MenuItem = ({ href, label }) => ( <Link href={href} className="menu-item"> ...

How to display a video with full height and width using CSS or JavaScript

I am trying to incorporate an html5 video (using the video tag) with 100% width and 100% height to play in the background. I have seen an example using an image, but I want to achieve the same effect with a video. Here is the code I have so far: #video { ...

Is it possible to serve CSS using relative paths that go beyond the URL root?

I've encountered a file path issue with my HTML and CSS files. My HTML file is located in: src/test/html/index.html And the corresponding CSS file is in: src/test/css/index.css In the HTML file, the CSS is linked using: <link rel="stylesheet" ...

The showdown: JQUERY $(document).click versus $(document).ready

$(document).ready(function(e) { if ($('#sidebar').hasClass('active')) { $('#dismiss, .overlay').on('click', function() { $('#sidebar').removeClass('active'); $('.overlay&apo ...

Despite being in perfect condition, my If-Else statement is refusing to function properly

I had previously posted a similar question, but it was removed. However, I am still very curious about why something seemingly trivial is not functioning properly. This is the entirety of my HTML and JavaScript code... <!doctype html> <html lang=& ...

One project contains a pair of React instances

I am currently working on a React Web App and recently encountered an issue with an 'invalid hook call' error. Upon further investigation, I discovered that there are duplicate copies of the React library in my project, including within the CSS f ...

Missing RequestVerificationToken value when hiding HTML element using jQuery

I am encountering an issue with my ASP.NET MVC 4 form that involves checkboxes being used to show and hide certain HTML elements. When I initially visit the form page, the RequestVerificationToken value is correctly created as a hidden field. Some HTML ele ...