How can I customize my navigation bar to resemble the design in the image?

I have been struggling to recreate a navigation bar that matches the design in the image provided below. Despite my efforts, I have only managed to come up with the code below. The method I used was inspired by a solution found on Stack Overflow, but I am unsure how to incorporate links and borders to mimic the desired look. Additionally, please note that the orange line beneath the navigation bar is not meant to be included. I do have a PSD Photoshop file containing elements of the navigation bar, which served as the basis for the nav_border.png image.

Goal navigation bar image

My current result

Here is my HTML code:

<div id="navbar">
    <ul>
        <li><a href="index.html">First time at auction ?</a></li>
        <li><a href="index.html">Next auctions</a></li>
        <li><a href="index.html">Rules</a></li>
        <li><a href="index.html">Terms of use</a></li>
        <li><a href="index.html">FAQ</a></li>
        <li><a href="index.html">Contacts</a></li>
        <li></li>
    </ul>
  </div>

This is my current CSS code:

#navbar {
    float: left;
    width: 776px;
    height: 40px;
    border-radius: 8px 8px 0 0;
    background-color: #003366;
}
#navbar ul {
    list-style-type: none;
}
#navbar li {
    float: left;
}
#navbar a {
    color: white;
    text-decoration: none;
}
#navbar li + li{
    background:url('nav_border.png') no-repeat top left;
    padding-left: 10px;
    margin-left: 30px;
}

Answer №1

Check out this fiddle to help point you in the right direction

https://jsfiddle.net/fx6gtj6o/

#navbar {

  background: blue;
  border-radius: 8px 8px 0 0;  

  ul {

    list-item-type: none;
    padding: 0;

    li {

      display: inline-block;
      text-align: center;
      padding: 10px 10px;
      border-right: 1px solid black;

      a {

        color: #FFF;

      }

    }

  }

}

You don't need to use any images from the mockup, CSS can handle everything

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

Eliminate the empty choice for Angular when dealing with dynamic option objects

Looking for assistance with this code snippet: <select ng-model='item.data.choice' > <option ng-if='item.data.simple_allow_blank == false' ng-show='choice.name' ng-repeat='choice in item.data.simple_choices&ap ...

Python: Exploring each column in a nested list to discover palindromes

Here is a list of words: [['r', 'o', 't', 'o', 'r'], ['e', 'v', 'e', 'i', 'a'], ['f', 'i', 'n', 'e', 'd'] ...

Building a custom dialog box using Angular Material with HTML and CSS

I've been exploring different approaches to create a customized angular material dialog with a unique header using CSS/SCSS and the TailwindCSS framework. I am aiming for a specific visual effect, similar to what is shown in the figure below. desired ...

Rendering an HTML div through jQuery

Is there a way to insert a div inside another div using jQuery? Here is the main div: <div id ="username_error"></div> And here is the div that should be placed inside it: <div class="alert alert-primary" role="alert"> This is a ...

Fixing the height of the body padding with JS or JQuery for a

I have a rather straightforward question that pertains to an issue I am facing while building a website using BS4. Specifically, my problem revolves around a fixed-top navbar with the class "fixed-top". The challenge stems from not knowing the actual heig ...

What is the best way to update the content of a div when it is being hovered over?

On my website I am building, there is a division that contains text. When I hover over the division, I want the text to change from "example" to "whatever". I came across a forum discussing this, but I'm having trouble understanding it. Can someone p ...

Learn how to extract an ID created with AngularJS using JavaScript

I have a piece of code that generates multiple divs using ng-repeat and assigns each one an id based on a specific value. <div ng-repeat="item in $scope.items"> <div id="ajs-{{item.title}}">{{text}}</div> <script> v ...

What is the best way to ensure that a bootstrap collapse feature is fully

How can I display the collapse button and text only on mobile devices while showing the uncollapsed content on desktop? I am considering using an example to display part of the text initially, with the rest revealed upon clicking a button. This method is ...

Dealing with numerous forms within a single function in Django views

Managing two forms within a single function: Web Page Content <form name="selectgenderform" method = "POST"> <select name='gender'> <option>Male</option> <option>Female</option> </select> & ...

Is it possible to increase the font size of the text on my MUI Slider's thumb for customization

Currently, I am utilizing the MUI-Slider component within React to showcase a value. My objective is to personalize the 'thumb' and valueLabel to boast a larger font size and thumb appearance. Despite referencing MUI's documentation on CSS c ...

Displaying API logs on an Html console

function updateData(e) { const animeName = e.target.value; const apiUrl = `https://nyaaapi.herokuapp.com/nyaa/anime?query=${animeName}`; fetch(apiUrl) .then((res) => res.json()) .then(displayAnimeData); } const inputField = document.getEl ...

A popular method for showing a div when another div is scrolled out of view, similar to the Timeline feature on Facebook

I have found Facebook's new timeline feature to be quite impressive. I particularly like the small menu that appears as you scroll down a profile, offering options to view the timeline or more information about the user. It only shows up when you reac ...

Maintain the button's placement

Hey there, I'm a newcomer to the world of development. Currently, I am working on a project that involves a button within a flex container setup. Here is the code snippet for the button: <div class="flex-item flex-item-button" > ...

Easily Conducting Target Audience Analysis with the (l, s, v) Approach and Compilation

My objective is straightforward - I need to analyze a data set obtained from a survey to determine the frequency of each potential answer given by different target groups. Although my current code is functional, it is bulky and prone to errors. I have atte ...

Modifying the href attribute of a hyperlink with jQuery

Is it possible to modify the href attribute of a hyperlink using jQuery? ...

Issues with displaying Angular Material's ng-messages in a dialog box

While working on a login form within a dialog, I noticed that the ng-messages for the respective input are not appearing. The validation is functioning properly as the input turns red when there's an error, and the button remains disabled until the va ...

Tips for staying on the same page when hovering over a table

My hover table contains multiple pages, with each row offering various actions one can take with an item. After performing an action, the page refreshes and returns to the first page of the table. Is there a way to stay on the same page after executing a ...

Retrieve custom attributes of child elements using jQuery selectors

I am looking to modify the data-answersetid attribute of all child controls under the .cloneable class in a table. Each row in the table contains a single control - either a textarea, checkbox, radio button, or input[type=number]. Each control has a custom ...

Hide the menu even if the user clicks outside of it or anywhere on the webpage

I have a menubar code that is functioning correctly. However, I would like to make an enhancement. Currently, when I click outside of the menubar, it does not hide or close. I want the menubar to be hidden when I click anywhere on the webpage while the men ...

Creating vibrant tables with unique color schemes using Thymeleaf

Is there a way to create a table with different colors using Thymeleaf? I have a list of events with risk weights represented by integer values. Each column in the HTML table should be colorized based on certain conditions. For example, if the risk is le ...