Responsive navigation challenge

I'm currently working on my portfolio and encountering some issues with the placement of my logo and navigation menu.

Here is the design I am aiming for: https://i.sstatic.net/ZPGw1.jpg

My goal is to have it displayed in that manner across 3 different breakpoints, but at the moment, the navigation bar overlaps with the logo instead of positioning itself below as intended. I had it functioning correctly before, but now I'm unsure about what caused it to go wrong. Any suggestions or advice would be greatly appreciated!

HTML:

<!DOCTYPE html>
<html>
<head>

    <title>Portfolio</title>
        <script src="js/jquery-1.11.0.min.js"></script>
        <script src="js/lightbox.min.js"></script>
        </script>
        <link href="css/lightbox.css" rel="stylesheet" />

    <link href="style.css" type="text/css" rel="stylesheet" />


</style>


</head>
<body>
<div id="wrapper">
    <div id="header">
    <div id="logo">
     <h1><a href="">NAME</a></h1>
    </div>
        <div id="nav">

            <ul>
                <li><a href="">HOME</a></li>
                <li><a href="">ABOUT</a></li>
                <li><a href="">CONTACT</a></li>
            </ul>
        </div>
    </div>

    <div id="content">

        <div class="article column1">
        <a href="new.mp4" rel="shadowbox;height=338;width=600" title="LOGO ANIMATION">         <img class="hoverme" src="images/animation1.jpg"></a>
        </div>
        <div class="article column2">
            <a href="images/northforest.jpg" data-lightbox="image-1" data-title="Logo Design"> <img class="hoverme" src="images/nfsmall.jpg"></a>
        </div>
        <div class="article column3">
            <a href="images/flyer.jpg" data-lightbox="image-1" data-title="Flyer"> <img class="hoverme" src="images/flyersmall.jpg"></a>
        </div>
        <div class="article column4">
            <a href="images/menu.jpg" data-lightbox="image-1" data-title="Flyer"> <img class="hoverme" src="images/menusmall.jpg"></a>
        </div>
        <div class="article column5">
        <a href="images/article.jpg" data-lightbox="image-1" data-title="Article"> <img class="hoverme" src="images/articlesmall.jpg"></a>
        </div>
        <div class="article column6">
        <a href="ahlogo.mp4" rel="shadowbox;height=338;width=600" title="LOGO ANIMATION"> <img class="hoverme" src="images/animation2.jpg"></a>
        </div>
    </div>
    <div id="footer">

    </div>

    </div>

<link rel="stylesheet" type="text/css" href="shadowbox.css">
<script type="text/javascript" src="shadowbox.js"></script>
<script type="text/javascript">
Shadowbox.init({
handleOversize:   "resize"
});
</script>
</body>
</html>

CSS:

    @font-face { 
  font-family: 'bikoblack';
  src: url('fonts/biko_black.otf');
  }

    @font-face { 
  font-family: 'bikoregular';
  src: url('fonts/biko_regular.otf');
  }

.hoverme {

border: 3px solid #d0d0d0;

 }  

 .hoverme:hover {
 opacity: .5;
 -webkit-transition: all .9s ease-in-out;
 -webkit-transition: all .4s ease-in-out;
 -moz-transition: all .4s ease-in-out;
}

a:link {
    color: #0f4c96;
}
a:visited {
    color: #0f4c96;
}
a:hover {
    color: #b2b1b1;
}
a:active {
    color: #0f4c96;
}

* {
    text-align: center;
    }
body {

    margin: 0;
    font-size: 100%;
    background-color: white;
     }
#wrapper {
    max-width:90%;
    margin:0 auto;

}


img {width: 100%; height: 100%;
}


h1 {
    font-family: 'bikoblack';
    text-transform: uppercase;
    font-size: 3.5em;
    line-height: 85%;
    color: #0f4c96;
    float: left;


    }
#header {
    position:relative;
    overflow:hidden;
}


#nav {

    position:absolute;
    bottom:1.25em;
    right:1em;
    }
li {
    display: inline;
    font-family: 'bikoregular';
    color: #0f4c96;
    padding-left: 2em;
    }


.column1, .column2, .column3, .column4, .column5, .column6 {        
    width: 32.66%;
    height: 15em;
    float: left;
    margin: 1% 1% .01% 0%;

    }       
.column3, .column6 {
    margin-right: 0%;}
    }


@media (max-width:767px) {
h1 {
    float: none;
    width:100%;
    text-align:center;
    }
#nav {
    position:static;
    width:100%;margin:0 auto;
    top: 5em;
}    
    li {
    width:100px;
    padding: 0 1em; 
}
}




@media (max-width:480px){
li {
    display:block;
    text-align:center;
    width:auto;
 }

 }

 a {text-decoration: none; }

Answer №1

Make some minor adjustments and correct the errors in your CSS code. Here's a revised version:

.hoverme {
    border: 3px solid #d0d0d0;
}
.hoverme:hover {
    opacity: .5;
    -webkit-transition: all .9s ease-in-out;
    -webkit-transition: all .4s ease-in-out;
    -moz-transition: all .4s ease-in-out;
}
a:link {
    color: #0f4c96;
}
a:visited {
    color: #0f4c96;
}
... (Additional CSS code included here)

Feel free to customize this layout to suit your needs. Check out this JS Fiddle link to experiment with it further. Remember, the way you structure your CSS is crucial for ensuring everything works correctly.

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 simplest way to alternate between graph view and table view using a toggle button in Ionic 6/Angular?

In my project, I have implemented two components to display data - a table view and a graph view. Both components feature the same dataset, and I have utilized a toggle switch button to seamlessly switch between these views. Below is the code snippet: < ...

jQuery can help in determining the cost based on chosen preferences

Here is my unique html code : <select class="form-control B3 pricing" name="B3"> <option data-price="0" data-cheap="0">0</option> <option data-price="20" data-cheap="30">1</option> <option data-price="40" data-cheap ...

How can you find the index of an HTML element while excluding any clearfix divs?

In the process of developing a CMS, I find myself in need of determining the index of the element I am currently working on. Consider the following stripped-down HTML structure: <div class="row"> <article class="col-md-4 col-sm-4 project" &g ...

Issue with jQuery select box (roblaplaca) and its custom scroll bar functionality not functioning as expected

Recently, I implemented the custom select box script from . This script allows for two select boxes, where the second one updates dynamically using AJAX when there is a change in the first select box. Below is a sample of the HTML code: <option>One& ...

Menu Toggle with Bootstrap 3

I have implemented two Bootstrap 3 navigation menus on a single page. One menu works fine when the toggle button is activated for responsiveness, but the other one doesn't work as expected. How can I resolve this issue? Below are the code snippets fo ...

Displaying from the left side to the right side

Having some issues with sliding from the left to right div that has display:none. <div class="second"> <li><a id="sale_man" rel="showinfo"><?php echo $lang['sale_man'];?></a></li> <li><a id="purch_man ...

Tips on choosing a text option from a selection menu

When I try to retrieve the text displayed in my select menu upon selection, I encounter a challenge. While this.value allows me to fetch the value, both this.label and this.text return as undefined. Is there a method to extract the visible text from the d ...

Enable the children elements' before and after content to surpass the limitations set by the parent's overflow property

I have a division with the overflow property set to scroll to view all fields without using too much page space. Each field includes a title span and an associated input. Users can hover over the spans to see helpful tooltips. I use the spans' after a ...

Using jQuery, identify when a key has been pressed within a three.js environment

How can I detect a keypress within a designated scene contained in a div with the id "world"? I've written the following code in an attempt to achieve this, but it doesn't seem to be working properly. Here is the code snippet: $('world&apos ...

Having trouble integrating an HTML template using JavaScript

I am currently attempting to integrate the HTML code of my website using data-prototype: <div id="accordion" data-prototype=' <div class="card-body"> <textarea id="solution_answers___name___content" name=& ...

What is the best way to incorporate background colors into the sidebar menus of grandchildren?

I am currently utilizing the advanced sidebar menus page which can be accessed through this link: https://wordpress.org/plugins/advanced-sidebar-menu/ Within the plugin, there are widgets that allow users to add background colors and text colors to child ...

css - Arranging pictures in a perfect row

On my webpage, I have 5 images and a div. Currently, the images are displaying one under another, but I want them to appear in a straight line while only showing one image at a time within the div. HTML CODE: <html> <head> <title>My Ci ...

Learn how to make a contenteditable div perform tab spacing with a simple keystroke of the tab key

I've been trying to figure out how to make this contenteditable div add tab spacing when I press the tab key, but so far no luck. If anyone has a solution for this issue, please feel free to share. You can use an ID, class, or any other method to get ...

What steps should I take to successfully implement a div ID selector in an HTML document?

<div id="nofries"> <h1 class="restaurant mt-5 ms-3">CRAZY GREEKS</h1> <h3 class="ms-5">GREEK FOOD, SUBS &amp; PIZZA</h3> </div> I'm having trouble with my div ID "nofries" not ...

Refresh the Dom following an Ajax request (issue with .on input not functioning)

I have multiple text inputs that are generated dynamically via a MySQL query. On the bottom of my page, I have some Javascript code that needed to be triggered using window.load instead of document.ready because the latter was not functioning properly. & ...

Utilize XQuery to manipulate both outer elements and inner elements

As a newcomer to XQuery, I am seeking assistance with the following XML example: <lg> <l n="1">Z nutz vnd heylsamer ler / verma⸗ </l> <l n="2">nung vnd ervolgung der wyßheit / ver </l> <l n="3"> ...

Dynamically Growing Navigation Bar Elements with Nested Subcategories Based on Class Identification

Let's say you have a menu bar structured as follows: <nav> <ul class="nav"> <li class="menu1"><a href="#">Menu Item 1</a></li> <li class="menu2"><a href="#">Menu Item 2</a> <ul& ...

Best Method for Adding 340 HTML Fields to an MS SQL Database with PHP

I am faced with the task of entering data from a large HTML form containing 340 fields into a Microsoft SQL Server 2008 R2 database. Trying to avoid manually coding each variable in PHP ($sql & $params), I wonder if there is a way to streamline this proces ...

What is the best way to center text within a div that is wider than 100%?

On my webpage, I have a header set to 100% width and text positioned on the banner. However, when zooming in or out, the text's position changes. How can I ensure that the text stays in place regardless of zoom level? Example: jsfiddle.net/5ASJv/ HT ...

Display a popover when the button is clicked using jQuery

Is there a way to show a notification message using popover? I've managed to make it work, but I'm facing an issue where the popover doesn't appear on the first click of a button after the page loads. Here is the code snippet: <button ty ...