Off-screen text on mobile devices due to bootstrap styling

As I was working on designing a landing page, I encountered an issue with the header file. When trying to shrink the page, the text in the header went off-screen while everything else seemed to work fine. I am hoping someone can shed some light on this problem.

So far, I have not used any JavaScript code.

.stage {
    background: url(img/Header/living-room-1517166_1920.jpg) center center no-repeat;
    background-size: cover;
    color: white;
    height: 100%;
    width: 100%;
    display: flex;
    align-items: center;
    
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet"/>
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>


<!--Navigation bar-->
<nav class="navbar navbar-expand-md navbar-light bg-light sticky-top navbar-fixed-top">
  <a class="navbar-brand" href="#">Wijkveiligheid</a>
  <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarText" aria-controls="navbarText" aria-expanded="false" aria-label="Toggle navigation">
    <span class="navbar-toggler-icon"></span>
  </button>
  <div class="collapse navbar-collapse" id="navbarText">
    <ul class="navbar-nav mr-auto">
      <li class="nav-item active">
        <a class="nav-link" href="#">Thuis <span class="sr-only">(current)</span></a>
      </li>
      <li class="nav-item">
        <a class="nav-link" href="#">Promo video</a>
      </li>
      <li class="nav-item">
        <a class="nav-link" href="#">Vergelijk</a>
      </li>
        <li class="nav-item">
        <a class="btn btn_primary" href="#">Login</a>
      </li>
    </ul>
  </div>
</nav>

<div class="stage" id="stage">
    <div id="stage-caption">
        <h1 class="display-3">Uw veiligheid is onze prioriteit</h1>
        <p class="HeaderP">Wij van wijkveiligheid kijken altijd hoe we het woongenot van onze medemens kunnen verbeteren en optimaliseren. Onze professionele adviseurs staan klaar om samen met u te kijken hoe uw huis ook optimaal beveiligd kan worden en klaar is voor de toekomst.</p>
        </div>
</div>

Answer №1

To solve the issue, I included a maximum width of 500px and adjusted the font size to 0.9rem.

@media screen and (max-width : 500px) {
    .HeaderP{
        display: flex;
        align-items: center;
        font-size: 0.9rem;
    }
}

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

The error undefinedspan is being thrown when using document.getElementById.value in conjunction with a span tag

While using document.getElementById.value on an input tag, I'm getting the correct value. <td ><input id="testing" data-bind="value: SPL_ApprovalDetailsObj.TgtSales "> </span></td> However, when I try the same with a span tag ...

Guide on showing a toast message labeled as "Busy" using Google Docs extension

Whenever I launch Spreadsheet or Doc add-ons from the respective stores, I notice a dynamic progress toast appearing at the bottom of the window: This feature doesn't seem to be present in my own add-ons, leading me to believe that it is not integrat ...

Tips for creating a scrollable smiley input field

I have a chat system where I am incorporating smileys from a predefined list. QUERY I am looking to create a scrolling feature for the smileys similar to how it is implemented on this particular website. The twist I want to add is to have this functiona ...

What is the process for adjusting the checkbox border color in Material Design 15 and above?

Ever since the latest update to Angular Material 15, I've noticed some changes in how styling is applied to Angular Material components. Previously, in version 14, I used to be able to accomplish styling changes with code like this: ::ng-deep .mat-che ...

Guide to taking a screenshot of an HTML page using Javascript, Jquery, and HTML5 functionality

I am looking to add a unique feature to my website - the ability to capture the current image of my webpage with just the click of a button. Inspired by Google's "send feedback" function, I want to implement something similar on my own site. After res ...

Utilize a while loop in JavaScript to trigger a message when a variable dips below zero

Forgive me if I seem clueless. I am a beginner in the world of Javascript and am currently experimenting with loops. At the moment, I am toying around with this particular piece of code: <!DOCTYPE html> <html> <body> <button oncl ...

Tips for retrieving file data from an input html element

Trying to perform a quick client-side file check for better user experience in JavaScript, but encountering an error that is puzzling. The file is obtained through an input element: The specific error message received is: Uncaught TypeError: Cannot read p ...

Discovering data in individual tr elements within a table with jQuery by utilizing .text()

I'm currently working on a project where I need to separate the three table rows within a dynamically generated table. My goal is to have jQuery treat each row individually in order to extract specific values like price and SKU. You can see an example ...

What is the best way to emphasize the chosen node in a treeview using jQuery?

.treeview ul { background-color: white; margin-top: 4px; } .treeview a:visited { background-color: Yellow; } .treeview a:active { background-color: Yellow; } .treeview a:selected { background-color: Yellow; } When I click on a node ...

Error encountered when attempting to call a JavaScript function by clicking on a link within a dropdown menu due to an unexpected end of

Here is the code snippet from my HTML file: <html> <head> <link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.1.0/css/bootstrap.min.css"> <link rel="stylesheet" href="http://netdna.bootstrapcdn.com/boots ...

What is causing the malfunction of the position within this particular section?

On my website, I have a specific section where I want to showcase four products with arrows on both sides for navigation. However, I am facing an issue with the positioning of the elements. Can someone take a look and help me figure it out? Check out this ...

What makes the AngularJS ng-repeat search term filter fail to function properly?

I am attempting to create a dynamic table that filters and displays only rows containing the search term entered in the search box. Following a basic example from the w3schools tutorial, I am trying to get it to work properly: https://www.w3schools.com/ang ...

Leveraging bootstrap4-toggle along with localStorage to switch between CSS styles for dark mode

I'm having trouble getting localStorage to work with Bootstrap 4 and the bootstrap4-toggle library from https://github.com/gitbrent/bootstrap4-toggle in order to implement a CSS dark mode toggle. The issue I'm facing is that the class dark is no ...

Modifying email alters the appearance of the input element

Utilizing labels as placeholder text behind input boxes with a transparent background, changing to white on :focus and when input value is > 0, I created a contact form. However, integrating PHP into the form recently caused styling issues. Although I m ...

Complications arising from IE when using strict doctype with CSS and jQuery

Here's the code I'm using for a sliding caption effect on my gallery site: I specifically implemented the last effect which is the Caption Sliding (Partially Hidden to Visible). $('.boxgrid.caption').hover(function(){ $(".cover", th ...

Gathering information in the form of a tuple with Selenium in Python

I'm having issues with gathering data as a tuple using Selenium with Python 3.6. The specific page I am trying to extract data from is located at (). My goal is to collect the "manufacturer (maker)" data from the search menu at the top of the page. h ...

An illustration of HTML frames

Is this method effective? <html> <body> <center> <frameset rows="50%,50%"> <frame src="images.html"> <frameset> <form action="abc.html"> <input type="submit" name="abc page" value="abc page"> </form> & ...

Tips for disabling modal scrolling on mobile when scrolling the div inside it

Currently, I am facing an issue with a bootstrap modal. I have created a div with overflow:auto inside the modal. Everything works fine on desktop, but on mobile devices, when I scroll the content of the div, the modal itself also scrolls. How can I preven ...

What's the reason for these bootstrap buttons being in such close proximity to one another

Why are these two bootstrap buttons so close together? Should I use some custom CSS to create space between them? On the documentation page here, they aren't touching. <link href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.mi ...

Adjusting the alignment of table cell contents without the use of JavaScript or external CSS files is necessary

I need help creating a table that resembles the design shown in the image below. I want each td cell in the outer table to have a number at the top right with a border, and text at the bottom left without a border: https://i.sstatic.net/1YTkR.png Current ...