Numerous lists conveniently consolidated within a single navigation bar

I am currently exploring the functionality of StumbleUpon's navigation bar by attempting to replicate it.

My approach involves using 3 lists within 1, structured like this:

<nav role="navigation">
        <ul id="rightnav">
            <li></li><!--
             --><li></li><!--
             --><li></li>
        </ul>
        <ul id="leftnav">
            <li></li><!--
             --><li></li><!--
             --><li></li>
        </ul>
        <ul id="centernav">
            <li id="dislike">&nbsp;</li><!--
             --><li id="stumble">STUMBLE</li><!--
             --><li id="like">&nbsp;</li>
        </ul>
    </nav>

This is my progress so far: http://jsfiddle.net/litari/yCT4D/1/

Unfortunately, I am facing challenges with aligning the three lists properly despite multiple attempts. Since I am relatively new to CSS, I assume there might be something basic that I am overlooking.

I would really appreciate any feedback on my CSS. If there are improvements to be made, please do let me know (and provide reasons why). I am eager to learn and enhance my skills! Thank you :)

Answer №1

Here is a suggestion for your code:

FIDDLE

ul
{
   list-style-type: none; 
}
nav{
    height: 30px;
    top: 0;
    right: 0;
    left: 0;
    position: fixed;
    width: 100%;
    background-color: red;
    text-align: center;
}
#lefttnav{
    float:left;
}
#centernav{
    display:inline-block;   
}
#rightnav{
    float:right;
}

Answer №2

Have a look at the CSS snippet below:

#leftnav, #centernav, #rightnav{
    display: inline;
}

You can also view and test this code on JSFiddle

Answer №3

Check out this fiddle for the code snippet: http://jsfiddle.net/Hive7/yCT4D/6/

This is the HTML code:

<body>
    <nav role="navigation">
        <div align='left' style='margin-left: -10px;'>
        <a href='#'>item 1</a>
        <a href='#'>item 1</a>
        </div>
        <div align='center' style='margin-top: -18px;'>
        <a href='#'>item 1</a>
        <a href='#'>item 1</a>
        </div>
        <div align='right' style='margin-top: -18px; margin-right: 15px;'>
        <a href='#'>item 1</a>
        <a href='#'>item 1</a>
        </div>
    </nav>
</body>

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

Using HTML to get the minimum date specified by a different date

Can someone assist me? I am trying to retrieve the minimum parameter for the second date field based on the value entered in the first date field: Check-In: <input type="date" name="checkin" min="<?php echo date('Y-m-d');?>" required& ...

"Struggling with a basic Javascript function to refresh parts of a web page by calling a .php

After spending several hours browsing the internet, I am still struggling to get this straightforward example to function properly. Could someone please lend me a hand? My goal is to use JavaScript to display the contents of a PHP file. The display should ...

Achieving text alignment with icons in Angular

I'm having trouble aligning my text with the icon next to it despite trying to adjust margins. I would really appreciate any help or suggestions on how to resolve this issue. <div class="notification" [ngClass]="{'no ...

Struggling to eliminate buttons upon clicking, but they persistently reappear (JavaScript, HTML)

I have encountered an issue with buttons in my table that I am struggling to resolve. Each row in the table contains a "Pack" action button, which when clicked, is removed to prevent accidental double-packing of items. Everything was functioning smoothly ...

Are there any jQuery Context Menu plugins clever enough to handle window borders seamlessly?

After reviewing UIkit, as well as some other jQuery Context Menu plugins, I have noticed that they all tend to exhibit a similar behavior: The actual menu div renders outside the window, causing valuable content to be hidden from view. Is there a way to ...

Issue: AngularJS Injector Module Error

Recently started learning angularjs and trying to set up an app. Here's a simple and direct way to do it: Angular controller: (function () { 'use strict'; angular .module('myQuotesApp') .controller(' ...

Centering divs using iPad media queries does not seem to work properly

While working on my website, I encountered an issue with displaying content properly on various mobile devices. I have implemented media queries for this purpose. Currently, on the main site, two divs (#wrap and #scrollbar) are positioned next to each oth ...

Designing a fresh look for the developer portal on Azure API Management Services

Is there a way to customize the color of the navbar links in the fresh developer portal for different layouts? I have attempted using the designer tool provided by the portal, but it hasn't yielded any results. I also tried cloning the git repository ...

Designing a photo frame slider for a unique touch

My skills in javascript and jQuery are limited, but I am looking to create a customizable slider. While exploring options like Flexslider (), I found it challenging to meet the following specifications: Eliminate color gaps between thumbnails Enable thu ...

What could be the reason for the malfunction of my checkbox styling?

I have designed custom checkboxes and radio buttons with CSS styling as shown below: input[type="checkbox"]:checked + label:after, input[type="checkbox"][checked="checked"] + label:after, input[type="radio"][checked="checked"] + label:after, input[type="r ...

I am unsure of the process for implementing an OnClick event to modify the colors of a square

Seeking guidance from the more experienced individuals here as I am just starting out. Any help would be greatly appreciated! This might seem simple to many of you, but for me it's quite challenging. This is how my HTML code looks: <html> < ...

Learn the method to display a particular post using its unique post ID

I need some help displaying two specific posts by utilizing their post IDs. I'm struggling with the code to retrieve and call these post IDs. Can someone assist me? /////////////////////////////// ////////////////////////////// <div class="foo ...

Preventing responsive elements from loading with HTML scripts

Currently, I am utilizing the Gumby framework which can be found here. Everything appears to be running smoothly. My goal is to incorporate a mobile navigation list where the links are grouped under a single button, as outlined here. Initially, this funct ...

What is the best way to apply a background-image to a DIV while also implementing a double line border to prevent the image from showing through the border?

Within my DIV, I have applied a background-image and added a double border to the DIV. The image is currently visible in between the lines. Is there a method to resolve this issue and prevent the image from displaying in this manner? ...

Creating eight equal sections within HTML <div> elements using Bootstrap

I am brand new to Angular. I need to design something like this: https://i.sstatic.net/Zcb9i.png However, I'm struggling to find the right solution. Here is what I have so far: https://i.sstatic.net/7hsrk.png. Having been a backend developer, I&ap ...

Design an HTML watermark input that remains visible as the user starts typing

I'm currently in the process of developing an application that enables businesses to access their account through theirname.mydomain.com. I am working on creating a signup form for this purpose. Today, I stumbled upon squarespace and noticed they hav ...

Steps for including a header and footer with page numbers in an HTML page without disrupting the rest of the content when printing

When I print a page with a table that spans multiple pages, I want to ensure that my header and footer are included on every page. The code I've tried so far has treated the entire content as one continuous page. How can I achieve this? ...

Having trouble with compiling SCSS code

While diving into the world of SCSS, I decided to compile my SCSS into CSS using npm. So I entered npm run compile: sass as defined in my package.json as follows: "scripts": { "compile:sass": "node-sass sass/main.scss css/style ...

Creating a vertical scrollable container that spans the full height of the PDF document

I am currently working on embedding a PDF file into my website. I'm trying to hide the status bar, including download buttons and page numbers, through some clever techniques so that I can control them externally. My goal is to be able to redirect use ...

having difficulty with an intricate flexbox grid within another flexbox

I attempted to create a grid-like pattern using a negative margin based grid system (Susy) but was unsuccessful. Next, I tried employing flexbox for the task. However, I'm unsure if it's achievable. My initial idea was to have 2 columns (side A ...