htmlcssheaderformathtml-heading

Header not responsive, causing overlap on buttons


I am very new at web development and am trying to figure out an issue I am having with my header. I want my header to be responsive and not cause an over-lap on the button elements next to it.

I have tried applying the position, float, and transform elements separately and all at once to the header sections and this does not seem to solve the issue or I just do not know how to properly use them.

Below is a sample of both my html and css.

HTML:

<header>
   <a href="Website.html"><img id="smallLogo" src="/Users/ultimateorganism/Desktop/Brown-Dev-Proj-Vol.1/FuturUImages/smallLogo.png" alt="smallLogo"></a> 
    <h1 class="bizPage">FuturU</h1>
    <div class="homeButtons">
        <a href="Website.html" class="btn btn-outline-light" id="linkHomePage">Home</a>
        <a href="Mindmovies.html" class="btn btn-outline-light" id="linkMindMovies">MindMovies</a>
        <a href="mailto:pbusko5@gmail.com?subject=I am interested in an affirmation/mindmap!" class="btn btn-outline-light" id="linkContact">Contact</a>
        <a href="About.html" class="btn btn-outline-light" id="linkAbout">About</a>
        <a href="Testimonials.html" class="btn btn-outline-light" id="linkTestimonials">Testimonials</a>
        <hr style="background-color: white; height: 3px; opacity: initial;">
    </div>
    <hr style="background-color: white; height: 3px; opacity: initial;">
  </header>

CSS Classes:

#smallLogo{
width: 110px;
height: 110px;
float: left;
}

.bizPage{
font-size: 80px;
color: white;
position: relative;
top: 30%;
left: 30%;
}

header{
background-color: black;
font-family: Courier;
justify-content: center;
}

.homeButtons{
position: absolute;
top: 32px;
right: 26px;
font-size: 8px;
}   

.lineHeader, .lineFooter{
   margin-left: auto;
margin-right: auto;
color: white;
height: 3px;
width: auto;
{

Any solution for this would be greatly appreciated. Thanks


Solution

  • Basically, if you want to make a fully responsive page/navbar, you may need to use the "Burger Menu". Looks like you have used Bootstrap. You can see this link

    Still, I'm trying to provide a measurable solution. Check the code and style as you want. I just have used a flex div at the html portion.

    header{
        width: 100%;
    }
    #smallLogo{
        width: 110px;
        height: 110px;
        /* float: left; */
        }
        
        .bizPage{
        font-size: 80px;
        color: white;
        /* position: relative; */
        top: 30%;
        /* left: 30%; */
        }
        
        header{
        background-color: black;
        font-family: Courier;
        }
        
        .homeButtons{
        /* position: absolute; */
        /* top: 32px; */
        /* right: 26px; */
        margin-top: 1%;
        font-size: 8px;
        }   
        
        .lineHeader, .lineFooter{
        /* margin-left: auto;
        margin-right: auto; */
        color: white;
        height: 3px;
        width: auto;
        {
    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>Stack Overflow</title>
        <link rel="stylesheet" href="style.css">
        <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
    
    </head>
    <body>
        <header>
            <div class="d-flex justify-content-between">
                <a href="Website.html"><img id="smallLogo" src="/Users/ultimateorganism/Desktop/Brown-Dev-Proj-Vol.1/FuturUImages/smallLogo.png" alt="smallLogo"></a> 
                <h1 class="bizPage">FuturU</h1>
                <div class="homeButtons">
                    <a href="Website.html" class="btn btn-outline-light" id="linkHomePage">Home</a>
                    <a href="Mindmovies.html" class="btn btn-outline-light" id="linkMindMovies">MindMovies</a>
                    <a href="mailto:pbusko5@gmail.com?subject=I am interested in an affirmation/mindmap!" class="btn btn-outline-light" id="linkContact">Contact</a>
                    <a href="About.html" class="btn btn-outline-light" id="linkAbout">About</a>
                    <a href="Testimonials.html" class="btn btn-outline-light" id="linkTestimonials">Testimonials</a>
                    <hr style="background-color: white; height: 3px; opacity: initial;">
                </div>
            </div>
             <hr style="background-color: white; height: 3px; opacity: initial;">
           </header>
    
        <!-- <script type="text/javascript" src="index.js"></script>  -->
    </body>
    </html>

    Let me know if it works for you.