Central logo navigation with paired links on each side

I am currently working on creating a navigation bar that features a centered logo with two links positioned on each side. My goal is to have the side links placed closer to the logo than the edges of the page. Initially, I attempted to achieve this using various properties such as position, top, left, etc. However, I encountered layout issues when viewing the website at lower resolutions. This led me to explore flexbox after learning about it in a recent YouTube video on HTML.

Any guidance or assistance provided would be greatly appreciated!

* {
    margin: 0px;
    padding: 0px;
    box-sizing: border-box;
}


.photoauraone {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    margin: auto;
    overflow: hidden;
    size: cover;
}


.logo {
    display: block;
    margin-left: auto;
    margin-right: auto;
    height: 5%;
    width: 5%;
}

.backgroundimage {
    background-image: url("photoauraone.jpg");
    background-size: cover;
    overflow: hidden;
    size: cover;
    height: 100vh;
}



header {
    display: flex;
    justify-content: space-between;
}

nav {
    order: -1;
    align-items: center;
}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>RADIO AURA</title>
    <link rel="stylesheet" href="css_index.css">
</head>
<body>
    <div class="backgroundimage">
        <header>
        <nav>
            <div class="container"> 
                <div class="wrapper">
                <ul class="left_links">    
                    <il><a href="">About Us</a></il>
                    <il><a href="">Shows</a></il>
                
                    <il><a href=""><img src="logo_normal_purple.png" class="logo"></a></il>
                    
                    <il><a href="">Player</a></il>
                    <il><a href="">Contacts</a></il>
                </ul>
                </div>
            </div>
        </nav>
        </header>  
    </div>  


    
</body>
</html>

Answer №1

The most straightforward and efficient solution would be to utilize the flex property.
In this example, I've incorporated display:flex, justify-content: space-between, and align-items: center.

I offer a concise solution to clarify my approach.

nav {
   display: flex;
   justify-content: space-between;
   align-items: center;
}
<nav>
  <div>
    <a href="#">link 1</a>
    <a href="#">link 2</a>
  </div>
  <img src="https://via.placeholder.com/150x50"/>
  <div>
    <a href="#">link 3</a>
    <a href="#">link 4</a>
  </div>
</nav>

For each attribute utilized, I have included a reference link for guidance. I trust this will assist you in your initial endeavors.

Answer №2

<!DOCTYPE html>
<html lang="en">
  <head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>RADIO AURA</title>
  <link rel="stylesheet" href="css_index.css">
  
<style>
    .container {width: 100%; max-width: 800px;}
nav {
    width: 100%;
   display: flex;
   justify-content: space-between;
   align-items: center;
}
</style>
  </head>
  <body>
  <div class="backgroundimage">
    <header>
        <div class="container">
            <nav>
              <div> <a href="#">link 1</a> <a href="#">link 2</a> </div>
              <img src="https://via.placeholder.com/150x50"/>
              <div> <a href="#">link 3</a> <a href="#">link 4</a> </div>
            </nav>
        </div>
    </header>
  </div>
  </body>
</html>

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

One CSS file linked, but only one is applied; the other is left unused

After including two CSS files, I am experiencing an issue where only one of them is being utilized. The other file does not seem to be included and the reason behind this remains unknown. My website has a standard header file that is present on all pages. ...

Managing sessions and cookies for Firefox forms

On my webpage, there is a poll form where users can vote and see the results through an ajax request. When a user votes, a cookie is created to prevent them from voting again upon returning to the page. However, I have encountered an issue with Firefox wh ...

The animation feature in Angular JS seems to be malfunctioning

Currently in the process of creating a slideshow using AngularJS, similar to the one found at this link, which includes navigation arrows (next and prev). Here is the HTML code snippet: <div class="carousel"> <div class="left"><input ty ...

Utilize Jquery to dynamically update form input in real time based on checkbox selections

I am working on a form that requires real-time calculation of GST (Goods and Services Tax) directly within the form (GST = Price/11) This functionality has been implemented with the following script. Additionally, the calculation needs to be adjust ...

Three-color linear gradient SVG with a middle color expanding in width

I'm working with a linear gradient and here is the code: <svg width="120" height="240" > <linearGradient id="dsp" x1="0" x2="0" y1="0" y2="1"> <stop class="stop1" offset="0%"/> <stop class="stop2" offset="50%"/> ...

Guide on adjusting padding for jQuery Flot graph for improved styling

I am utilizing jQuery Flot to generate a basic graph. I do not want the axes to display on either side, but this is causing the points to be slightly cut off. Any suggestions on how to resolve this issue? $.plot('#'+id, [ { data: data.values ...

retrieve the value of an HTML element once it has been modified

When I am working in a view, I encounter an issue where I need to retrieve the value of an HTML input box after it has been changed. Initially, the page loads with the following code: <input id="input_one" type="text" value = "apple" /> Upon loadin ...

What steps can be taken to create a seamless navigation experience that effectively emphasizes the user's current location?

Is there a way to dynamically add the "current" class to the navigation menu based on the user's current location on the page? This would make it easier for users to see which section of the site they are viewing as they scroll through. Check out this ...

Resizing an image with six corners using the canvas technique

Currently, I am facing two issues: The topcenter, bottomcenter, left and right anchors are not clickable. I'm struggling with the logic to adjust the image size proportionally as described below: The corner anchors should resize both height and wi ...

Developing components through JavaScript

I am attempting to use JavaScript to create an element in my HTML using createElement, but there seems to be an issue in my code. HTML <button class="test_button">I am a test</button> <div class="test"></div> ...

What is the best way to display a new row within a row in Bootstrap 4?

Struggling to design a header image with text positioned at the bottom? Despite creating rows and columns, the text keeps moving to a new line. I need to have two instances of text in the header image, but adjusting absolute position has not helped. I&apos ...

The website content is not visible on Internet Explorer version 10

Issue with Internet Explorer 10 I recently completed a new website for our company: . However, I am encountering some challenges with the site when viewed on IE 10 on Windows 7. For some reason, a large portion of the text is not displaying properly in IE ...

Image is positioned absolutely and appears when the parent element is flipped

I've encountered an interesting issue in Chrome (works perfectly in Firefox), and I'm unsure how to resolve it. http://jsfiddle.net/GkXA7/1/ When hovering over the card, the image appears flipped on the backside. However, if I adjust the image&a ...

Novice problem with the <div> tag

I am currently in the process of developing a website, and I have encountered an issue with the title not staying within the designated div box at the top of the page. <div style="width:1000px;height:40px;background:grey;border:3px solid;border-radiu ...

Troubleshooting problems with jQuery mmenu on Windows Phone (IE Mobile)

I am currently working on optimizing the mobile version of a website, utilizing jQuery MMenu for the menu. The functionality is seamless on various phones and tablets I have tested, except for Windows Phones... Even with the plugin configured with the "po ...

Transferring Data through the POST Method

Is there a way for me to send just one variable using the post method? I have retrieved the $row[id] from the database and need to include it in the form submission. We know how to send user input using dfs, but what about sending the specific $row[id] v ...

Tips for creating a vertical scrollbar within a row component

Is there a way to create a scrollable parent v-row with a child v-row overflowing with content so that I can nest another v-row inside the v-col and ensure it remains within the scroll element? <v-row> <v-col> <v-row> <p ...

Step-by-step guide on repairing a countdown clock using JavaScript, HTML, and

I'm having issues with my JS on my website. I am new to this and currently in the process of setting up a website. I want to add a timer to show when the site will be active. It seems like there is an error somewhere in the JS code that I can't ...

Steps for building a Bootstrap grid of thumbnails

I need to display an unknown number of thumbs. Below is a sample of the HTML rendered: <div class="row-fluid"> <ul class="thumbnails"> <li class="span3"> <a href="#" class="thumbnail"> &l ...

Utilize buttons to sort through and refine card displays in Bootstrap 4

On my landing page, I have 40 cards belonging to different categories or groups. There are a total of 5 categories. I am looking to add 5 buttons that, when clicked, will display only the cards from specific category or categories. I do not want to use a s ...