``header logo that adjusts to all screen sizes with accompanying text

I am looking to modify my header layout for mobile viewing. Currently, on larger screens the logo is displayed with text beside it. However, on mobile devices I want the text to appear below the logo, possibly condensed to just one line with a bullet point separating them. The issue I am encountering now is that when I view the site on mobile, the logo and text resize but the text becomes too large and falls off the screen.

You can find the site at: jeepscycleclub.x10host.com

Below is the CSS code for the #pageheader:

#pageheader {
    -moz-align-items: center;
    -webkit-align-items: center;
    -ms-align-items: center;
    align-items: center;
    display: -moz-flex;
    display: -webkit-flex;
    display: -ms-flex;
    display: flex;
    -moz-justify-content: center;
    -webkit-justify-content: center;
    -ms-justify-content: center;
    justify-content: center;
    position: relative;
    text-align: center;
    overflow: hidden;
    background-color: #2f2f37;
    max-height: 15vh;
}

    #pageheader img {
        max-height:15vmax;
    }

And here is the HTML code:

<div id="pageheader">
<img src="images/pageheader.gif">
    <header>
    <h2 style="font-size: 3vh;">Club Info: 316-755-0909</h2>
    <h2 style="font-size: 3vh;">FM 100.9 for Race PA System</h2>
    </header>
</div>

This website is still in the testing phase as I work out these layout changes before making it live.

Thank you for your help.

Answer №1

To fix this issue, simply add the following CSS property: flex-wrap: wrap;. Additionally, make sure to adjust the width or max-width value to allow enough space for text to flow under the logo.

#pageheader {
    -moz-align-items: center;
    -webkit-align-items: center;
    -ms-align-items: center;
    align-items: center;
    display: -moz-flex;
    display: -webkit-flex;
    display: -ms-flex;
    display: flex;
    -moz-justify-content: center;
    -webkit-justify-content: center;
    -ms-justify-content: center;
    justify-content: center;
    position: relative;
    text-align: center;
    overflow: hidden;
    background-color: #2f2f37;

    flex-wrap: wrap;
}

    #pageheader img {
        max-height:15vmax;
    }
<div id="pageheader">
<img src="http://placehold.it/150x80/a0f">
    <header>
    <h2 style="font-size: 3vh;">Club Info: 316-755-0909</h2>
    <h2 style="font-size: 3vh;">FM 100.9 for Race PA System</h2>
    </header>
</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

What is the most effective approach for managing ResponseEntity on the user interface?

I need to display all posts written by a user and their friends on the user's page after it loads. What is the most straightforward way to achieve this on the UI side? I am using Thymeleaf with Spring. @RequestMapping(method = RequestMethod.GET, pat ...

Trouble with CSS matching pattern - not functioning as expected

I am facing a requirement to customize the colors of ribbon styles instead of using the default ones. After researching pattern matching in CSS, I attempted the following code, but it did not work: This is my original CSS: .ms-cui-cg-**tl** .ms-cui-ct-f ...

Error message: "An issue occurred: Unable to access undefined properties (specifically, borderRadius) in MUI react."

I recently created a navigation bar with an integrated search bar component. The styling for my search component was done using MUI styled from @emotion/styled in MUI library, where I applied a borderRadius: theme.shape.borderRadius. However, I encountere ...

Issues arise when Django static files fail to load without any error indicators

Upon running the django server and attempting to load HTML files, I encountered an issue where CSS files were not loading. There were no visible errors on either the terminal or the website itself, just a loading animation in the background. To address thi ...

What is the best way to align this in the middle on iOS?

Screenshot Greetings, I am facing an issue with centering an element on Apple devices. In the screenshots provided, you can see how it appears on iOS, Android, and a Windows PC. Despite trying various methods, I have been unable to solve the problem. Can ...

Equal height images using Bootstrap 4

Is there a way to display images with the same height but different width in a row while maintaining responsiveness? For instance, I would like to showcase 3 images side by side in a row, ensuring that each image has a consistent height. <div class= ...

Trouble with z-index | initial div out of four malfunctioning

Currently, I am attempting to practice by replicating the design shown in this image: https://i.sstatic.net/iIA2q.jpg However, I have encountered an issue that has been persisting for some time: https://i.sstatic.net/grABz.png I'm struggling to un ...

Utilizing the transform: origin property to perfectly align an element

I've tilted a basic paragraph and I'm attempting to position it on the left side of the browser at 0% from the top of the browser at 50%. http://example.com p { position: fixed; -webkit-transform-origin: left center; -webkit-transfo ...

What is the best way to make a CSS element embrace another element positioned either above or below it?

I've been attempting to arrange multiple CSS shapes to hug each other, but I'm facing some difficulties. After researching online, the only solution I came across was using inline-block. However, I'm struggling to achieve the desired outcome ...

The data from my ajax code is not being successfully transmitted to the database

I'm having trouble using ajax to add data to the database. I'm not sure if the issue lies in the ajax code or the PHP code. Here is a snippet of my code: <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></ ...

Enhancing Widget Titles in Wordpress with a <span>

Looking to customize the color of the first word in a widget title on a WordPress site? I'm running WP v.3.7.1 with a custom child theme based on twentythirteen. All it takes is wrapping the first word in a <span> tag and then styling it as nee ...

Is there a way to automatically populate my form with data depending on the value selected in a dropdown menu?

I'm facing an issue with prefilling a form based on the selected value from a dropdown menu that loads invoice IDs from my database. The problem arises when trying to populate the form fields using the data corresponding to the selected invoice ID. Th ...

Aligning elements vertically within a parent container

I am facing a problem where elements are not aligning vertically in the center of their parent div. CSS: /* Main body structure */ body{ font-size:0.5em; } .main-wrapper { width: 90%; margin: auto; background-color: #efefef; } * { ...

Is my Jquery UI Dialog failing to send input data?

My dialog box isn't capturing input fields when posted, and I can't figure out why... I've tested it on Mac using Firefox and Safari, as well as on Windows with IE and Firefox, but the inputs are not being posted. Disabling the dialog box a ...

The group icon will dynamically change based on the selection made in the dropdown menu

I am currently working on a Bootstrap dropdown select for weather in my Razor Pages project. My goal is to have the input group icon change dynamically based on the selected weather option. For example, I want to display a cloudy icon when the user selects ...

I'm attempting to access CapCut through the site with Selenium, but I'm having trouble clicking on a specific button

My goal is to click on a specific button with the following code: <button class="lv-btn lv-btn-primary lv-btn-size-default lv-btn-shape-square lv_sign_in_panel_wide-primary-button" type="button"><span>Continue</span>&l ...

Set the title attribute according to the content of the <p> tag

Recently, I encountered a situation where I had numerous p tags with a specific class (let's call it .text). My task was to include the title attribute containing the text of each tag. For example: <p> Hello, world </p> This would resul ...

HTML Input Hidden : Completely Concealed

I have been working on creating a 'captcha' for my website, and this is the code I am using: <form class="captcha" method="post"> <label><?php echo $captchas ?></label><br> <input name="captcha" /> <input t ...

What is the process of extracting a URL and inputting it into a form to enhance

Can anyone help with extracting a specific value (TEXT) from a URL and automatically paste it into an input form field? For example, if the URL is domain.com/page?code=123abc, I need to grab the code (in this case, 123abc) and have it automatically popula ...

developing a segment within an HTML document

Recently, I came across a fascinating website at . I was particularly intrigued by the way the right and left columns expand and contract dynamically when clicked. As someone new to web development, especially in terms of dynamic websites using jQuery, I ...