Struggling to properly position content with Bootstrap and CSS

I have been tasked by my mentor to create a website based on a wireframe that he sent me. However, I am facing difficulty in positioning the text on these "hero" images.

https://i.sstatic.net/Xw19o.jpg https://i.sstatic.net/uBdaa.jpg

The text seems to be stuck on the right half of the container, which is strange because offsetting them should have moved them over to the left. Unless, of course, I made a mistake.

I haven't made many changes and I am confused, especially since I used an offset in the same document that worked correctly. I tried using classes like justify-content-left, but they seemed to hit an invisible barrier in the middle of the container.

<div class="p-2" id="navigationFilter">
            <div class="container">
                <div class="row">
                    <div class="col-lg-6 offset-lg-6">
                        <header class="pt-5">
                            <p>Enjoy peace of mind knowing that you can</p>
                            <h1>Quickly send for help and alert loved ones</h1>
                            <button class="btn btn-lg btn-primary" type="button">Get Started</button>
                        </header>
                    </div><!-- col -->
                </div><!-- row -->
            </div><!-- container -->
        </div><!-- translucent-->

Answer №1

To fix the alignment issue, it is recommended to eliminate the offset-lg-6 class from your code.

Adjusting Offset Classes

If you need to shift columns to the right, utilize the .offset-md-* classes as they adjust the left margin of a column by the specified number of columns. For instance, with the .offset-md-4 class, you can move .col-md-4 over four columns.

-- https://getbootstrap.com/docs/4.3/layout/grid/#offset-classes

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

Tips for changing the value of a span element in an ng-repeat loop

Utilizing ng-repeat to populate my data model, I am facing an issue with displaying the first character of each contact's first and last name inside a circle shape. Below is the code snippet I am using for this purpose: HTML: <ul class="collectio ...

Is it possible to use a TypeScript Angular (click) event with an object property as the value?

Seeking assistance in creating a dynamic error card featuring various error messages along with a retry button. Below is a snippet from my TypeScript object: errorCard: any = []; if(error) { this.errorCard.errorMessage = "Oops, please try again"; ...

Creating an HTML table with a fixed header and dynamic columns is a useful feature for displaying various

How can I dynamically create a table with fixed headers and dynamic columns based on the click of HTML buttons using AJAX and jQuery? For example, if the "3days" button is clicked, the table should have 2 fixed headers and 3 dynamic columns with names 1, 2 ...

What is the best method for converting Unix time to a readable date

<el-table-column label="Time Created" prop="create_time"></el-table-column> https://i.stack.imgur.com/aoLjf.png The timestamp data from the backend is in milliseconds format (e.g. 1527150668419) and is stored as create_time property in this.i ...

Seeking out all (including potentially relative) URLs on a webpage: Possible strategies to consider

For a coding challenge, I am working on a small python tool to download an entire website locally. In order to view the website offline, I need to convert all URLs to relative URLs. This is necessary to ensure that resource files (such as .js and .css) are ...

Tips for creating an HTML page with the dimensions of an A4 paper sheet?

My goal is to display the HTML page in a browser while containing the content within the dimensions of an A4 size page. Additionally, when printed, the HTML page should be formatted to fit onto A4-sized paper pages. <div classNa ...

Struggling to extract feedback with Selenium in Python

I am looking to extract reviews from a specific webpage on Sephora's site: . When inspecting the reviews, I found this example syntax: <div class="css-7rv8g1 " data-comp="Ellipsis Box ">So good! This primer smooths my skin and blurs my pores so ...

Adding a slight 1px right margin between an HTML table and its enclosing div in Bootstrap 3

Help! I'm trying to troubleshoot some HTML issues and can't figure out where this pesky 1px gap between my table and the wrapping div is coming from... Just for reference, I am using Bootstrap. I suspect that it could be a glitch in the Bootst ...

Animation initiated when clicking the show/hide button to transition to the next page

Having recently delved into the realm of website programming, I was able to make some adjustments to the CSS code of my Wordpress theme called Expositio (wpshower / themes / expositio). One particular piece of code that caught my attention is what I belie ...

Ensure your div's absolute position is set to the right for a sticky effect

When I set the position of an absolute div like this: left: 700px; It does not move when I resize my browser window. How can I make it float to the right and move left when resizing the window? To illustrate the issue, take a look at this site. Check ou ...

Guidelines on receiving a user's color input and showcasing it with JavaScript

/* Take a color input from the user and apply it to the variable called "message". */ <script type="text/javascript"> var textcol, message = "Great choice of color!"; textcol=window.prompt("Please enter a color:&quo ...

Use PHP to dynamically assign a class to each <option> element within a loop

How do I go about adding a CSS class to every option within my code? Here is the PHP code provided, and you can refer to the screenshot below for where the class property should be placed - what adjustments should be made in order to include a class in eac ...

Error in Angular 8: Property 'name' is undefined and cannot be read

Delving into the world of Angular, I encountered an interesting error: ERROR TypeError: Cannot read property 'name' of undefined. Here's the snippet of code: recipe-list.component.ts import { Component, OnInit } from '@angular/core&ap ...

Prevent the Focus on Submit Button in CSS

Whenever a text field is focused in Opera, the submit button ends up with an unsightly black border. A screenshot clearly shows this issue. At the bottom of the image, you can see how the textarea is focused and the submit button looks unappealing. Is th ...

When I adjust the window size, the media queries cause the responsive side menu to quickly show and hide

After creating a responsive side menu that automatically appears when resizing the browser window, I encountered an unexpected issue. The side menu seems to appear and disappear quickly without clicking on the designated button. This particular problem is ...

The anchor tag is not displaying CSS styling as expected

The links on my page are not displaying the styling from the CSS file I added. HTML: <%@page contentType="text/html" pageEncoding="UTF-8"%> <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text ...

Responsive grid made with HTML and CSS to create dynamic DIVs

Currently, I am working on a project that requires a responsive page layout using divs. The layout should resemble a grid, with 3 columns that reorganize into 2 columns on smaller screens. Here is the basic HTML structure I have so far: <div id="main" ...

How to Center a Button in a Menu Using CSS

I've been struggling for a while now trying to design a menu with standard buttons on the left and a single button on the right. I've experimented with various techniques using ul li and applying styles like float, but nothing seems to work! No m ...

What could be causing document.getElementById to return null?

I've been troubleshooting my code and noticed that one of the methods in my JavaScript file is not functioning correctly. Does anyone have any insights into why this might be happening? index.html: <!DOCTYPE html> <html lang="en"> <he ...

The display function in Javascript has a tendency to work sporadically

I’ve been tasked with creating my own tic tac toe game through coding. While I am relatively new to programming, I have a strong passion for it. At the moment, I've set up a basic function to hide only the "O", leaving only the "X" visible on the gr ...