Mobile view div failing to fill remaining space

When viewing my website on a mobile device, the heading in the div tag is not occupying the remaining space like it does on desktop. The heading is an h4 tag inside a div tag for mobile view. If you want to check out my website in inspect mode, here is the link: enter image description here I am using Bootstrap 5.0.2 for this old project that I am working to complete.

Here is the HTML for two headings:

<div id="features" style="background-color: #E7E7E7;" class="container-middle-center-fluid">

    <section style="padding: 0;">

      <div class="container-middle-center py-3" style="margin-left: 0; margin-right: 0;">
        <h2 class="pb-2 border-bottom text-center" style="margin-top: 48px;">Specialities</h2>

        <div class="row row-cols-1 row-cols-sm-2 row-cols-md-3 row-cols-lg-4 g-4 py-5 justify-content-center">  

          <div class="col d-flex align-items-center column-custom">
            <img class="d-none d-lg-block" width="120px" height="auto" style="margin-right: 50px; margin-right: 50px;"
              src="/img/mobile_friendly.png" alt="">

            <div>
              <h4 class="fw-bold mb-0 mobile-text"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"
                  fill="currentColor" class="bi bi-phone d-lg-none mobile-icon" viewBox="0 0 16 16">
                  <path
                    d="M11 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h6zM5...
              <p class="d-none d-md-block">A responsive design makes your website accessible to all users, regardless of
                their device.</p>
            </div>

          </div>
          <div class="col d-flex align-items-center column-custom">
            <img class="d-none d-lg-block" width="120px" height="auto" style="margin-right: 50px; margin-right: 50px;"
              src="/img/content management.png" alt="">

            <div>
              <h4 class="fw-bold mb-0 mobile-text"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"
                  fill="currentColor" class="bi bi-kanban-fill mobile-icon" viewBox="0 0 16 16">
                  <path
                    d="M2.5 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h11... 
             <p class="d-none d-md-block">Custom WordPress theme and plugin development. Easily update content without
                knowing how to code.</p>
            </div>
          </div>



        </div>
      </div>

    </section>
  </div>

CSS:

@media (max-width:768px) {
    .mobile-text {
        font-weight: 600 !important;
        font-size: medium;
        /* color: red; */
        font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    }

    .mobile-icon {
        margin-right: 10px;
        color: #018673;

    }

    .footer-mobile-text {
        display: flex !important;
        justify-content: center;
    }

    .mobile-footer-padding {
        /* padding: 0; */
        /* margin: 0; */
    }
}

Scripts and CSS included:

<link href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="30525f5f44434442514070051e001e02">[email protected]</a>/dist/css/bootstrap.min.css" rel="stylesheet"
    integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="1e7c71716a6d6a6c7f6e33777d71706d5e2f302f2e302a">[email protected]</a>/font/bootstrap-icons.css">
<script src="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="61030e0e15121513001121544f514f53">[email protected]</a>/dist/js/bootstrap.min.js"
    integrity="sha384-cVKIPhGWiC2Al4u+LWgxfKTRIcfu0JTxR+EQDz/bgldoEyl4H0zUF0QKbrJ0EcQF"
    crossorigin="anonymous"></script>

In mobile view, I want the header in the div tag to be on a single line, but currently, it's not taking up the available space to the sides.

Answer №1

The problem lies in the necessity to include width:50%; for all six divisions, namely E-Commerce, Analytics, Mobile-friendly, Content Management, Design Development, Website Audits...

<div class="row row-cols-1 row-cols-sm-2 row-cols-md-3 row-cols-lg-4 g-4 py-5 justify-content-center" style="
">
          <div class="col d-flex align-items-center column-custom" style="
    width: 50%;
">
            <!-- <svg class="bi text-muted flex-shrink-0 me-3" width="1.75em" height="1.75em">
              <use href="/img/cart.png">
            </svg> -->
            <img class="d-none d-lg-block" width="120px" height="auto" style="margin-right: 50px; margin-right: 50px;" src="/img/cart.png" alt="">


            <div>
              <h4 class="fw-bold mb-0 mobile-text"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-cart2 d-lg-none mobile-icon" viewBox="0 0 16 16">
                  <path d="M0 2.5A.5.5 0 0 1 .5 2H2a.5.5 0 0 1 .485.379L2.89 4H14.5a.5.5 0 0 1 .485.621l-1.5 6A.5.5 0 0 1 13 11H4a.5.5 0 0 1-.485-.379L1.61 3H.5a.5.5 0 0 1-.5-.5zM3.14 5l1.25 5h8.22l1.25-5H3.14zM5 13a1 1 0 1 0 0 2 1 1 0 0 0 0-2zm-2 1a2 2 0 1 1 4 0 2 2 0 0 1-...


        </div>

On a Mobile view of 496px * 508px, the output is as follows:

https://i.sstatic.net/UxgrK.png

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

Hovering over one element in Jquery triggers actions on multiple elements simultaneously

I'm working on a project where I have multiple cards, and I've implemented a hover effect using jQuery to make the images inside the cards bigger. However, I'm facing an issue where hovering over one card triggers the effect on all the other ...

Looking to connect information

I have written the following code and I am trying to bind data to ng-model. When I use ng-model = "value", I can see the value in the text field, but I want to update the value when the text input is changed. <tbody ng-repeat="action in model.editAct ...

I am trying to use ajax to upload a photo in ASP.NET MVC, but when the file reaches the controller, it is showing

I am trying to upload a profile photo using Ajax in ASP.NET MVC, but I am encountering an issue where the upload parameter is coming as null to the action method. Here are the HTML codes for the file upload section: <div class="preview"> <di ...

The target="_blank" attribute does not seem to function properly within an iframe

I've been tackling the WordPress media library tab recently. Within this iframe, I included a link with target="_blank". My expectation was for this link to open in a new browser tab or window, but instead, it opens within the iframe tab. Here's ...

Displaying mysqli results within a div while incorporating an onclick event for a javascript function that also includes another onclick event for a separate javascript function

I'm struggling to figure out the correct way to write this script. Can someone please guide me in the right direction or suggest an alternative method? I've searched but haven't found any relevant examples. I am fetching information from a ...

Customizing the colors of an Ant Design header

I am currently attempting to modify the background color of the entire header in antdesign. I believe the file containing the default settings can be found here: https://github.com/ant-design/ant-design/blob/master/components/style/themes/default.less Upo ...

showcasing diverse outcomes

I am currently developing a game and I'm stuck on determining which syntax to utilize. My goal is to input any letter into a text box and have it display a different letter. For example, typing the letter 'a' should result in 'H' b ...

What is the best way to locate a subnode in XML using XSLT?

I've recently taken over a project that involves using xslt to transform certain html elements. I have been able to successfully match with '/', but I'm encountering issues when trying to run it on a subnode. While searching for soluti ...

What could be the reason for the absence of an option in the navbar

As I work on creating a navbar menu that functions as an accordion on desktop and mobile, I encountered an issue. When I click on the dropdown on mobile, it displays one less item than intended. This seems to be related to a design error where the first it ...

How can I use jQuery to transform a div with its elements into a canvas?

Looking for a way to convert a HTML Div and its elements to canvas, and then the canvas to an image using Jquery. I've checked out a website that only converts the whole HTML page, but I need a solution for converting specific Div elements. Any help w ...

Google Map in Bootstrap FullScreen Mode Not Mobile-Friendly

Could you please take a look at the provided link and advise me on why the map is not responding correctly? I am also facing issues with the positioning of the map on the page, so any guidance on adjusting it appropriately would be greatly appreciated. Be ...

Internet Explorer (on mobile devices) does not display submenus when touched

Hello, I have a query about displaying a sublist on touch. I have created a sublist that is supposed to show up when you hover over it. You can view the demo here: @import url(//fonts.googleapis.com/css?family=Titillium+Web:400,200,300,600,700); body { ...

Python Selenium Webdriver: Issues with retrieving text content from hidden elements

I am interested in extracting data from Netflix that includes the following details: 1. Show Name 2. Season 3. Episode Name for each season 4. URL for each episode 5. Duration of each show. Selenium version: 3.141.0 Python version: 3.6.6, utilizing Chr ...

Utilizing CSS-in-JS to eliminate arrow buttons from a TextField

I'm currently developing a webpage using React and Material-UI. One of the components I have is a TextField element, and I need to remove the arrow buttons that typically appear on number input fields. If I were utilizing CSS, I could easily achieve t ...

Troubles with aligning and floating three divs in the center of a container div – a CSS conundrum illustrated with code snippets and a basic diagram

I'm struggling to center 3 divs within a "container." Here's a rough idea of what I'm going for: ______________________ | ___ ___ ___ | | |___| |___| |___| | |______________________| The issue I'm facing is g ...

What is the proper way to mention JavaScript packages when including them as parameters in Angular elements within HTML?

I was looking to enhance the command to be more authoritative. <div (click)="lastCall(999)">click me</div> My attempt to utilize Number.MAX_SAFE_INTEGER resulted in an error from my computer stating that it wasn't recognized. As a result ...

Why isn't my Bootstrap affecting Angular?

Hello, I am currently working on a project using Angular. Recently, I installed Bootstrap and added it to angular.json, but unfortunately, the changes did not take effect even after restarting the app. Here is the code snippet that I am currently using: h ...

Adhering button for sliding side panel

Check out my JSFiddle HERE to see what I have done. I would really appreciate it if someone could help me figure out how to make the show button float with the sidr panel :) <style type="text/css"> #panel { position: fixed; top: 50%; r ...

Stop horizontal overflow of content

This unique Vuetify demo on CodePen showcases a two-column layout. The first column contains a <v-list> enclosed in a green <v-alert>. By clicking the "toggle text" button, you can switch the title of the first list item between short and long ...

Removing an unnecessary DIV element from an HTML Document

I have been working on a News application and am utilizing a web product to fetch News Headlines. When I request a NewsHeadline, the product sends back an HTML Code containing the News Headline. <div class="mydiv"> <script type="text/javascript ...