Struggling with making the image mobile-friendly

I'm having trouble making both the image and text responsive on mobile devices. Could there be an issue with the CSS code I'm using with Bootstrap 4?
Here is the code snippet:

HTML file

<header class="masthead d-flex">
<div class="container text-center my-auto">
  <div class="row">
    <div class="col-lg-10 mx-auto">

  <img src=" " alt="" class="rounded-circle" width="600" height="400">

  <h3 class="mb-5">
    <h3 style="font-family:courier;">ABC</h3>

  </h3>  
</div></div></div>
<div class="overlay"></div>

CSS

 .masthead {
 min-height: 30rem;
 position: relative;
 display: table;
 width: 100%;
 height: auto;
 padding-top: 8rem;
 padding-bottom: 8rem;
 background: linear-gradient(90deg, fade-out($white, 0.9) 0%, fade-out($white, 0.9) 100%);
 background-position: center center;
 background-repeat: no-repeat;
 background-size: cover;
 h1 {
 font-size: 4rem;
 margin: 0;
 padding: 0;
     }
 @media (min-width: 992px) {
 height: 100vh;
  h1 {
  font-size: 5.5rem;
   }
 }
  }

Any assistance on fixing this issue would be greatly appreciated!

Answer №1

Here is the solution to your coding issues:

1) Make sure to correct the media query. 2) Change all instances of h1 to h3. 3) Use percentage or vw/vh for font sizing instead of rem.

.masthead {
 min-height: 30vw;
 position: relative;
 display: table;
 width: 100%;
 height: auto;
 padding-top: 8vw;
 padding-bottom: 8vw;
 background: linear-gradient(90deg, fade-out($white, 0.9) 0%, fade-out($white, 0.9) 100%);
 background-position: center center;
 background-repeat: no-repeat;
 background-size: cover;
 }
 
 img{
 width:60vw;
 height:40vw;}
 
 h3 {
 font-size: 4vw;
 margin: 0;
 padding: 0;
     }
 @media (min-width: 992px) {
 
  h3 {
  font-size: 5.5vw;
  color:green;
   }
 }
<header class="masthead d-flex">
<div class="container text-center my-auto">
  <div class="row">
    <div class="col-lg-10 mx-auto">

  <img src=" " alt="" class="rounded-circle" >

  <h3 class="mb-5">
    <h3 style="font-family:courier;">ABC</h3>

  </h3>  
</div></div></div>
<div class="overlay"></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

Designing Databases without the restrictions of SQL

Currently, I am exploring SQL and NoSQL databases, specifically MySQL and DynamoDB on AWS. I have been working on a dating/social network project, where I used a MySQL database with approximately 50 tables for organizing data logically. I utilized SQL que ...

FadeOut/FadeIn Iframe Animation

Help needed with making an iframe fade in and out using jQuery. Something seems off with the code and I can't figure out why it's not working. Can anyone spot the mistake? HTML <body> <center> <div class="headbackground" ...

The Bootstrap Modal retains the "display: block" property even when it is hidden

My web app has a bootstrap modal that seems to have a mind of its own. Even when I use myModal.modal('close');, the modal stubbornly stays displayed. It's a strange problem that's really frustrating. Every so often, about one out of te ...

The Bootstrap Carousel cannot be manually manipulated to switch images

I've run into an issue while trying to integrate a Bootstrap carousel gallery on my webpage. Although the photos automatically change after a few seconds, I am unable to manually switch them using the control buttons. Even after including Jquery, Po ...

What are the steps to successfully implement "Pointermove" event delegation in Safari iOS for parent/child elements?

I've encountered an issue that I'm struggling to find a solution for. My goal is to implement an event delegate using pointermove on a parent container, and I need to be able to detect when the event transitions between a child element and the pa ...

What steps should I take to eliminate the gap between two side panel components?

Let's take a look at the concept I am working on: https://i.sstatic.net/RyQAB.png I'm aiming to extract the statistics element within the red outline. The spacing issue between the stats and balance panels perplexes me. To align these panels to ...

Arrange, Explore (Refine), Segment HTML Chart

Is there a way to efficiently sort, paginate, and search (based on a specific column) data in an HTML table? I've explored several JQuery plugins such as DataTable, TableSorter, Picnet Table Filter, but none seem to offer all three functionalities (se ...

Designing numerous vertical lists in HTML

I need help with displaying multiple lists vertically using HTML For example: +--------+---------------------------------------------+--+ | Global | Region Country Currency Account Type Entity | | +--------+---------------------------------------------+ ...

Navigate to a fresh webpage and find the scrollbar sitting at the bottom

When launching a new website using my forum system, I want the scrollbar to automatically be at the bottom so users don't have to scroll down. I'm not experienced in JavaScript and need help creating the code for this feature. ...

Set the height of a div based on the height of another div

My challenge involves a textarea that dynamically expands as content is added to it. The structure of the textarea within a div element is illustrated below: <div id='sendMes' class='container-fluid'> <form action='#&apos ...

Authorize a user through Loopback using REST as the data source

I am currently working with a UserModel that is based on the USER model and uses a REST datasource. "UserModel": { "dataSource": "mock", "public": true } Data Source Configuration "mock": { "name": "mock", "baseURL": "http://localhost:3000/", "connector ...

I'm having trouble getting my <aside> HTML tag to align properly within my grid section

I'm struggling with setting up grids. I have defined the boundaries and everything seems to fall into place within the grid, except for my aside element that I want to appear on the right side of the screen. Interestingly, this issue arises when using ...

Creating mobile-friendly buttons: a step-by-step guide

How can I make my button responsive? I have a button on an image within a slider. It looks good and works fine on desktop, but on mobile it appears too big and gets overlapped with the slider radio icons, causing the "read more" link button to not redirect ...

How can we use CSS and JavaScript to transform <td> elements into a visually appealing bar graph?

Is there a way to visually represent a percentage in an HTML table cell using either CSS or JavaScript? I want to create a bar graph effect next to the percentage value, and I'm unsure which method would be easier. The web page is built using a combin ...

Alignment of Multiple Backgrounds in CSS3 on a Vertical Axis

Utilizing CSS3 allows for the use of multiple background images. Suppose there is a DIV container with dimensions: div {width:100px; height:200px;}. If I have 4 background images sized at 100/50px, can they be aligned vertically to completely fill the DI ...

What is the best way to incorporate width adjustments in an image source for a responsive website?

Currently learning CSS and experimenting with it on an HTML page. For reference, I'm using this link. Encountering an issue with a responsive header image that adjusts size based on device (small on mobile, large on desktop). Is it possible to achiev ...

What is the best way to halt the ticking of this clock in JavaScript?

I can't seem to figure out how to stop this clock using JavaScript Even though I press the stop button, the clock keeps running <!DOCTYPE html> <html> <head> <h1> Welcome to the clock. Press the stop button to halt the clo ...

Utilizing non-breaking spaces in Django templates alongside Bootstrap 4 badges

I am attempting to maintain text generated using the Django template language within a Bootstrap 4 badge along with some additional text that is outside of the badge. Below is the code I have: <span>Submitted&nbsp;by:&nbsp;<span class="b ...

What could be causing the horizontal scroll bar to appear on the Web Page, even though it should fit perfectly on

I've designed this website to perfectly fit within the browser window, but for some reason, there's a horizontal scrollbar appearing. When a site fits properly, there shouldn't be a need for a horizontal scroll bar. I double-checked my zoom ...

CSS - Resizing Images

I am experiencing an issue with the width of an image on my website. I want it to span 100% of the browser frame, but it is currently limited to only 1000px wide. Please take a look at: The image in question is located at the top of the page. Is there a ...