What could be the reason my heading element text is not aligning to the center as I anticipated?

CSS Section

@media only screen and (max-width: 700px) {
  body {
    h1.h1 mb-0 text-gray-800 {
      text-align: center;
    }
  }
}

Bootstrap Section

<div class="container-fluid" style="overflow: hidden;">

          <!-- Page Heading -->
          <div class="d-sm-flex align-items-center justify-content-between mb-4">

            <h1 class="h1 mb-0 text-gray-800" >View Services</h1>

          </div>

Is there a way to center the h1 text within this content?

Answer №1

If you're not utilizing columns, consider using Bootstrap's grid system to easily center text without the need for media queries. Check out Bootstrap's documentation for more information on how to make content responsive: https://getbootstrap.com/docs/4.0/layout/grid/ The documentation provided by Bootstrap is incredibly helpful.

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

jQuery class does not apply correctly in IE9

Currently, I'm designing a menu for a WordPress theme and facing a styling issue. I aim to differentiate between menu items with submenus and those without by applying different styles on hover. Here's the jQuery code snippet I am using: $(docum ...

Locate the unordered list if its immediate parent is a list item

Here is the HTML code snippet I am working with: <div class="nav-collapse collapse"> <ul class="nav"> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown <b class="caret">< ...

The email width is exceeding 600px in all Outlook email clients

Fellow developers, I need your expertise! I've spent hours testing this email and researching why it's not conforming to a width of 600. Below is my code snippet and screenshots from Email on Acid - everything looks great except in Outlooks (exce ...

Which specific scoped CSS selector should I use to modify the width of the mdDialog container?

Is there a way to override the max-width of 80vw set on .mat-dialog-container in an Angular Material dialog? I want to create a truly full-width dialog. The issue lies with scoping--Angular-CLI compiles component CSS using scope attribute selectors. This ...

Tips for dynamically loading a modal

Hello, I am curious about dynamically loading modals on different images within my current webpage. https://i.sstatic.net/yhTgs.png For example, when the life of Pi image is clicked, a modal pops up displaying relevant information. https://i.sstatic.net ...

Creating an HTML Canvas using an AngularJS template

I am facing an issue with rendering html elements on a canvas using html2canvas JS. I am utilizing AngularJS for data binding on the html page, but unfortunately, the dynamic data is not showing up on the canvas generated from these html elements. For inst ...

A plug-in for TinyMCE that allows users to adjust column widths within a table

We utilize TinyMCE in our content management system (CMS), and our users have expressed interest in being able to adjust the width of a column within a table. While HTML technically does not recognize columns, the Moodle editor HTMLAREA includes a plugin t ...

The issue I am facing currently revolves around the absence of images on

I recently uploaded a captivating HTML page for my website's captive portal. Although the redirection to the designated page is working perfectly, I am facing an issue with the images included in the HTML page. Even though I went ahead and uploaded th ...

PHP sending only a single space in an email

My HTML form works perfectly fine, except for one field! The issue arises with a particular text field that I fill out using a button and a short JavaScript function. Could this be causing a conflict with the PHP code? The problematic text field is: inpu ...

What is the best way to incorporate a jQuery script to make an engaging slideshow on my website?

I've been trying to develop a slideshow similar to the one showcased on this website. First of all: I am using Kompozer. My website is not yet live as I am still in the process of putting it together on my computer. To give you an idea, here is the d ...

Guide to Display Three.js Code Suggestions in an HTML Document

I've exhausted all possible options to enable Three.js intellisense, but it simply refuses to appear. I've tried every known method in the manual. What's the missing piece here? Please share your insights. <!DOCTYPE html> <h ...

Enhancing the appearance of dropdown menus for WooCommerce Variable products with custom CSS styling

I currently have a Wordpress website with WooCommerce and several variable products. Each product's variation has a dropdown menu that displays different options when clicked. My main concern is how to customize the appearance of these dropdown menus ...

Leveraging Google maps to find nearby stores

I recently created a store locator but hit a roadblock when I discovered that Google Maps does not allow you to iframe the entire page. Is there a workaround for this issue to display the map? Or is there an alternative method that doesn't involve ifr ...

The dynamic duo of web development: React and Bootstrap JavaScript

As I work with ReactJS, I have come to understand that using JQuery or vanilla JS to directly manipulate the DOM is not recommended. This is because ReactJS operates using a virtual DOM, which can lead to unpredictable outcomes. My question now is: if I w ...

Click the 'expand' button for additional details on every row in the table

I am facing a challenge with my HTML table where I have a lot of information to add for each row. However, displaying everything at once makes the page look cluttered. Therefore, I am looking to add a "view more" button in another column for each row. Des ...

Tips for hiding a div only on mobile devices while always displaying it on large screens using AngularJS or CSS

How can I use Angularjs or css to hide a div on mobile devices only, ensuring that it is always displayed on large screens? ...

Preventing text from being obscured by images in flexbox using DIV elements

Check out my layout and CSS code: body { font-family: Helvetica, sans-serif; background-color: #B2BEB5; } b { font-family: Helvetica, sans-serif; } h1, h2, h3, h4, h5, h6 { font-family: Helvetica, sans-serif; } } .flex-container { font-family: Ar ...

What is the best method to substitute a comma and period with just a period in a textarea

Creating a text area with auto-replacing characters like straight quotes, double dashes to em dash, and double spaces to single space was simple. However, I'm facing difficulty in adding a script for replacing certain characters: word . as word. wor ...

Tips for creating space between table columns

I am looking to enhance the spacing between columns in my table to achieve a layout similar to the reference image provided. Can you suggest any adjustments I can make to my code to achieve this look? Reference table : https://i.sstatic.net/xfqiR.png He ...

Positioning html images to overlap each other without losing the ability to click

Currently, I am facing a challenge with positioning two images over each other. The back image should be at the bottom, while the center image needs to be on top of it. Additionally, there is a requirement for placing a random link (in this case google.com ...