CSS formatting for a fixed navigation on the right side

Creating a responsive design involves setting widths based on percentages.

Check out the code in this jsfiddle : http://jsfiddle.net/1x3whaat/

HTML

<div id="header">

<div id="callout">
Call us: 0123 456 7890
Support: 0123 456 7890
<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="30434540405f424470475552435944551e535f1e455b">[email protected]</a>

</div>
<div id="logo">
    <a href=""><img src="img/logo.png" alt="Logo" title="Logo" /></a>
</div>
<nav>
    <ul>
        <li><a href="">Home</a></li>
        <li><a href="">About</a></li>
        <li><a href="">Solutions</a>



        </li>
        <li><a href="">Consultancy</a></li>
        <li><a href="">Support</a></li>
        <li><a href="">Contact Us</a></li>
    </ul>   

</nav>

<!-- /header -->
</div>

CSS

div#header{
max-width: 1600px;
width: 98%;
position: relative;
background: #ff99ff;

height: 150px;
}

div#header > div#callout {
width: 30%;
position: absolute;
top: 0px;
right: 0px;
background: #99ff99;
font: 4em;
}

div#header > div#logo > a > img {
height: 135px;
}

nav {
margin: 0;
padding: 0;
width: 60%;
position: absolute;
bottom: 0px;
right: 0px;
background: #066;
}

nav > ul {
list-style: none;
margin: 0 auto;
padding-right: 0;
}

nav > ul > li {
float: left;
border-left: 1px solid #c3b371;
border-right: 1px solid #c3b371;
border-bottom: 1px solid #c3b371;
border-top: none;
width: 13%;
}

nav > ul > li > a {
background: #fcf5d2;
display: block;

font-weight: normal;
font-size: 1em;
text-transform: uppercase;
color: #81673d;
text-decoration: none;
text-align: center;
height: 1.5em;
}

nav > ul > li > a:hover, nav > ul > li > a.active, nav > ul > li.active > a {
background-color: #482501;
color: #fff;
}

This is an image of how it currently looks:

Here is an image of the desired final result:

I've experimented with floats, padding, margins, and changing positions but haven't been able to achieve the desired layout. Can anyone provide some assistance?

Answer №1

Styling with CSS :

nav > ul {
    list-style: none;
    margin: 0 auto;
    padding-right: 0;
    text-align:right;
    padding:0;
}

nav > ul > li {
    display:inline;
    border-left: 1px solid #c3b371;
    border-right: 1px solid #c3b371;
    border-bottom: 1px solid #c3b371;
    border-top: none;
    width: 13%;
}

In addition, please make sure to eliminate display:block; from the nav > ul > li > a selector.

JSFiddle Example

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

Ways to connect to a minimized hidden tabindex component using the hashtag symbol

I have created a glossary with terms in columns and hidden texts using plain css/html. Each entry is structured like this: A term followed by a hidden explanation, revealed on focus without the use of Java or JS. Instead of using :hover, I utilize :focus ...

Struggling to smoothly transition between two templates within a Django application

I'm facing an issue while switching between different templates in a Django (v3.2) application named 'manage_remittance'. The initial landing page for this app, using the template manage_remittance/templates/manage_remittance/view_remittance ...

Tips on setting up media queries for Bootstrap's responsive design functionality

I recently began incorporating Bootstrap 3.0's responsive design elements into my project. As a newcomer to Bootstrap 3, I would like guidance on how to create media queries for responsiveness within the framework. How can I effectively add responsive ...

The Telegram Login component is not displaying properly within a React single-page application

I am currently working on a React frontend application that was created using create-react-app, with Django running at the backend. We have separate development and production environments, each with its own domain. My goal now is to integrate a widget int ...

Creating an HTML SELECT element without a default blank option in the dropdown list using Angular

Issue: I am encountering a problem with setting a blank item to appear in the dropdown list of my form in Angular and JavaScript. As someone who is new to both languages, I have not been able to find a solution yet. Currently, my code looks like this: $ ...

showcasing a row of 10 items all at once

How do I make my bubble chart responsive? I want to display only 10 bubbles for large screens and have the number of bubbles per row decrease as the screen size gets smaller. I initially tried setting the width of each bubble to 10%, but it didn't wor ...

Tips on making sure video player controls are always visible on an HTML5 video player

Can anyone help me with my HTML video player? I am trying to make the control bar display always, instead of just when hovered over. Any suggestions? ...

Use Html.ActionLink to trigger events in various sections of the code

I'm attempting to create an ActionLink that will trigger an action in a different section of the code. Here is what I have so far: <div class="col-md-4"> @Html.ActionLink("Click to Perform Action", "Action", "SomeController") </div> ...

Guide to customizing color themes using Twitter Bootstrap 3

Recently, I dove into the world of Twitter Bootstrap 3 without any prior experience with earlier versions. It's been a learning curve, but I managed to set up a WordPress theme using it as the framework. All my elements are in place, but they all see ...

The way Chrome interprets the CSS class height and width attributes for input tags can vary

I was working on developing and testing a section of HTML div when I encountered an issue. After placing that section in another HTML page, the input tag CSS appeared to be rendered differently. This led me to enter debug mode. Interestingly, the CSS box ...

The ng-repeat directive in my Angular app's div element is being displayed as a comment

After spending several days searching, I have yet to find a solution for my issue. It seems to be specific to the code I'm working with in Angular 1.6. I apologize for the format of my post, as this is my first time seeking help on stack overflow ...

Bent CSS3DObject in Three.js

I'm attempting to manipulate a CSS3DObject in Three.js by bending it: var element = document.createElement('iframe'); element.src = 'https://example.com/'; var cssObject = new THREE.CSS3DObject( element ); However, I'm unabl ...

Achieve equal height columns when they are stacked vertically using Bootstrap 5

Can columns be equal height when they become rows on mobile devices? <link href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="57353838232423253627176279677965">[email protected]</ ...

Tips for uploading a file with PHP

Can someone please assist me? I am having trouble getting this to function properly. <form action="accept-file.php" method="post" enctype="multipart/form-data"> Your Photo: <input type="file" name="photo" size="25" /> <input type="s ...

Tips for improving the speed of loading infinite scroll pages

I am currently working on scraping over 100k rows from the provided URL. The data goes back approximately a month, loading in batches of 7-8 rows at a time. My current approach involves using a macro to scroll down the page slowly, which is effective but ...

Learn the simple trick to switch to full screen by just clicking

import { Component, OnInit, ElementRef } from '@angular/core'; declare var JQuery : any; @Component({ selector: 'app-presentation', templateUrl: './presentation.component.html', styleUrls: ['./presentation.c ...

Center image and text horizontally within a div, with padding surrounding them

CSS Challenge <div id="container"> <img src="1.jpg" /> <span>text next to image</span> </div> Can you apply CSS to center the image and span within the div container, with a 5px padding between the image and spa ...

Removing the outline border from a Material IconButton when clicked using styled Components: A guide

Is there a way to remove the outline border that appears when using a material iconButton and it is clicked? I've tried various methods without success. Can styled components help achieve this? Take a look at the image below. Image https://i.sstati ...

Eliminating vertical spacing between words with CSS

I am trying to nest a span within a button <span style="font-size: 11px; font-weight: 700; white-space: normal; margin-left: -5px;">UPGRADE PLAN</span> When I use white-space: normal, it breaks the word UPGRADE PLAN vertically. However, I am ...

Enroll a nearby variable "Data" to an Observable belonging to a different Component within an Angular application

Looking to update the HTML view using *ngIf, depending on a local variable that should change based on an observable variable from a shared service. HTML <div class="login-container" *ngIf="!isAuthenticated"> TypeScript code for the same componen ...