Bootstrap grid shifting

Having an issue with configuring one of my bootstrap hero units to respond properly to an offset command:

<div class="col-xs-6-offset-3 col-md-6-offset-3 col-lg-6-offset-3">
    <div class="center hero-unit">
        <h1>text</h1>
    </div>
</div>

Despite it displaying and having CSS styles applied, the unit is spanning across all 12 grids instead of just 6 as intended. Any suggestions on how I can center it while only taking up 6 grids?

Answer №1

Your use of classes needs adjustment. Begin by defining the column width (or span, if that's easier for you to understand) and then add an offset. Here is an example:

<div class="col-xs-2 col-xs-offset-3 
            col-md-6 col-md-offset-3 
            col-lg-6 col-lg-offset-3">
    <div class="center hero-unit">
        <h1>text</h1>
    </div>
</div>

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

What could be the reason for Chrome breaking up this straightforward bootstrap header into two lines?

Why is it that the code below displays correctly in one line in both FF and IE, but Chrome for some reason is showing it on two lines as if both span and button elements had "display:block;"? Even though the button has a computed display of "inline-block," ...

In CAKEPHP, emphasize a row in a Product table to indicate a comparison condition, without the need for hovering

I've been experimenting with different approaches to make this comparison work. Despite trying various methods, only the "gumboots" string check seems to do the trick. This string represents a product name in the table and proves that PHP is not neede ...

Applying jQuery to target a specific class and manipulate its CSS attributes

My portfolio is designed so that potential employers can easily view samples of my work in specific programming languages. For example, if they are interested in seeing projects involving PHP only, they simply tick the PHP box and all relevant samples will ...

What is the process for animating classes instead of ids in CSS?

My webpage currently features a setup similar to this. function wiggle(){ var parent = document.getElementById("wiggle"); var string = parent.innerHTML; parent.innerHTML = ""; string.split(""); var i = 0, length = string.length; for (i; i ...

The performance of ASP.net text-boxes is inconsistent

After days of searching for a solution, I am still unable to resolve my issue. My website features a simple web-form with text-boxes that are supposed to appear when the user selects the "custom search" option. While testing locally, everything works fine. ...

Transforming the responsive design of Twitter Bootstrap 2.0 into a fully fixed layout

The GitHub repository for Twitter Bootstrap's 2.0-wip branch now features an innovative responsive layout system. While it's ideal for applications requiring a high degree of responsiveness, I am currently working on a web-exclusive app that dema ...

Guide on placing an <img> within a navigation bar

I am currently working on a Bootstrap 4 navbar that includes both a logo and text in the navbar-brand section. However, I am facing difficulties in positioning the brand-logo and text accordingly. <!doctype html> <html ...

What is the process for creating a List Grid View utilizing this particular code?

I attempted to modify the stylesheet extensively and also created a small function in JavaScript, but unfortunately it did not yield the desired results. <div class="row featured portfolio-items"> <div class="item col-lg-5 col-md-12 col-xs ...

Conceal the initial modal beneath the overlay when the second modal is activated

I have a situation where I am using a modal that contains a button to trigger a second modal. The issue is that the overlay of the second modal does not hide the first modal, it simply darkens the background. How can I make the overlay of the second modal ...

Overlay a semi-transparent gray layer onto the background color

My Table has various TDs with different background colors, such as yellow, red, green, etc., but these colors are not known beforehand. I am looking to overlay a semi-transparent gray layer on certain TDs so that... The TD with a yellow background will t ...

"Taking cues from Instagram's web/desktop design, we have created

When you view someone's instagram page on a desktop or pc, the search bar is designed to float left when clicked, allowing text to be entered for searching. If no text is entered in the search field, the search icon and placeholder return to their ori ...

The background image is failing to load

Why isn't my background image showing up? Check out the jsFiddle here CSS Styles .arrow_icon { display: block; width: 320px; // 25 height: 240px; // 25 background-image: url(http://s12.postimg.org/yi7yl766z/5b8nbn.jpg); backgrou ...

Apply the CSS property to all divs with a shared class using jQuery

I am facing an issue with applying the CSS property 'z-index:99' to multiple divs that have the same class name. I want this CSS to be applied when clicking on a play button using jQuery. Currently, it only works for the first Play Button and I w ...

My JavaScript code runs perfectly fine on JSFiddle, but for some reason, it's not functioning correctly on

I need a solution where a new button is generated every time the post button is clicked, and each of these buttons should have its own counter. This works successfully in JSFiddle, but unfortunately doesn't work when I try to implement it elsewhere. ...

Non-sticky hamburger menu is not fixed in place

Having trouble with the hamburger menu staying sticky? The hamburger icon remains in the corner as you scroll down, but the menu stays fixed at the top of the page, making it hard to access. You tried tweaking the code you found on Codepen, but couldn&apos ...

"Creating a fixed header with jQuery by manipulating the offset and scrollTop

My goal is to create a smooth scrolling website that scrolls vertically using jQuery. I found a helpful tutorial called Smooth Scrolling Website and have been following it closely to build my site. However, I'm facing an issue with a fixed header - t ...

Navigable tabs in PhoneGap using AngularJS

Currently, I am developing a Phonegap application using angularJS and bootstrap. My goal is to incorporate a sliding tabs view similar to the implementation found on Android at http://developer.android.com/design/patterns/swipe-views.html. This functiona ...

Is there a way to shift the map to the right side without disrupting the text placement?

please provide image description Here is the code snippet: <div class="row w-100"> <div class="col-lg-6 my-4 offset-lg-1"> <iframe src="#" width="600" height=&q ...

What could be the reason my CSS styles are not taking effect when trying to flip an image?

I am facing an issue with an app that has a two-sided HTML element. The goal is to flip the element when a user clicks a button. I have been experimenting with different approaches without success. Here is the code snippet I have been working on: HTML < ...

Tips for evaluating style modifications on mouseover using cypress

Trying to test hover styles on table rows but encountering issues: Here is the code snippet I am testing: it("Table rows should display correct hover styles", () => { cy.get("table>tbody>tr").each(($el, index, $list) =&g ...