CSS for Aligning Navigation Bar Min-Width

Can someone assist me with properly scaling my navbar (e.g. min-width 800px) and setting up the phone number div with space between it and the links? This is my first try at this, so any help is greatly appreciated. Thank you.

CSS

<style type="text/css">
html, body {
padding: 0;
margin: 0;
}
#navbar { 
background:#212221 repeat-x; 
height:25px; 
color:#FFF;
padding:px 0px 0px 20px;  
}
#nav {
background:#212221 repeat-x; 
width: auto;
float: left;
font-size:14px;
font-family:GeosansLight;
margin: 0 0 3em 0px;
margin-left:500px;
padding: 0;
list-style: none;
min-width:700px;
}
#nav li {
float: left; 
    }
#nav li a {
    display: block;
    padding: 3px 10px;
    text-decoration: none;
    color: #fff;
}
#nav li a:hover {
text-decoration: underline; 
color:#FFF;}
#number {
background:#212221 repeat-x; 
width: auto;
float:left;
font-size:16px;
font-family:GeosansLight;
margin: 0 0 3em 0px;
margin-top:3px;
margin-left:200px;
padding:0;
list-style: none;
 }

#number li {
float: left; 
    }
#number a {
    display: block;
    padding: 0px 10px;
    text-decoration: none;
    color: #fff;
}
#header { 
background:#FFF repeat-x; 
height:80px; 
color:#FFF;
padding:0px 0px 0px 0px;  
}

</style>

HTML

<body>
<div id="navbar">
<ul id="nav">
<li><a href="/index.html">HOME</a></li>
<li><a href="/about.html">ABOUT US</a></li>
<li><a href="/gallery.html">GALLERY</a></li>
<li><a href="/faq.html">FAQs</a></li>
<li><a href="/contact.html">CONTACT</a></li>
</ul>
<div id="number">
<a>951-226-5620</a>
</div>
<div class="header">
<img src="images/kingstudlogo.png"/>
</div>
</body>

Answer №1

Here is the updated code for you to review and see if it meets your requirements.

CSS

html, body {
    margin: 0;
    padding: 0;
}
#navbar {
    background: none repeat-x scroll 0 0 #212221;
    color: #FFFFFF;
    height: 25px;
}
#nav {
    background: none repeat-x scroll 0 0 #212221;
    float: left;
    font-family: GeosansLight;
    font-size: 14px;
    list-style: none outside none;
    margin: 0 0 0 319px;
    min-width: 481px;
    padding: 0;
    width: auto;
}
#nav li {
    float: left;
}
#nav li a {
    color: #FFFFFF;
    display: block;
    padding: 3px 10px;
    text-decoration: none;
}
#nav li a:hover {
    color: #FFFFFF;
    text-decoration: underline;
}
#number {
    background: none repeat-x scroll 0 0 #212221;
    float: left;
    font-family: GeosansLight;
    font-size: 16px;
    list-style: none outside none;
    margin: 3px 0 0 200px;
    padding: 0;
    width: auto;
}
#number li {
    float: left;
}
#number a {
    color: #FFFFFF;
    display: block;
    padding: 0 10px;
    text-decoration: none;
}
.header {
    background: none repeat-x scroll 0 0 #FFFFFF;
    color: #FFFFFF;
    height: 80px;
    padding: 0 0 0 330px;
}

HTML

<div id="navbar">
    <ul id="nav">
        <li><a href="/index.html">HOME</a></li>
        <li><a href="/about.html">ABOUT US</a></li>
        <li><a href="/gallery.html">GALLERY</a></li>
        <li><a href="/faq.html">FAQs</a></li>
        <li><a href="/contact.html">CONTACT</a></li>
    </ul>
    <div id="number">
        <a>951-226-5620</a>
    </div>
</div>
<div class="header">
    <img src="images/kingstudlogo.png"/>
</div>

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

Preserving the scroll position of "md-content" when navigating between various views using "ngView"

While using angularJs and implementing ngView, it's known that scroll position is maintained when navigating back and forth between different views. However, I've incorporated angular material directives like md-toolbar and md-content in my views ...

execute php sql after a certain delay

Currently, I am working with PHP, SQL, and JavaScript to develop a friend request system. In this system, if User-1 sends a friend request to User-2, User-2 must accept the request within 1 hour. If not, the request will be automatically denied or removed. ...

`Cannot locate the CSS file on my local server`

My Node.js application uses the Express.js framework, and I am attempting to execute the following code: app.use('/public', express.static(path.join(__dirname,'public'))); However, I encountered the following error message: The CSS ...

"Enhance Your Website with Custom jQuery Preloaders

Currently, I am facing a challenge while developing a website. Specifically, I am struggling with resolving the issue of a blank page being displayed. The website that I am working on involves functionality where swiping right triggers data insertion into ...

Design a stylish outline for the element <div class="loader">

Initially, I managed to create a border around the body without any issues. However, I encountered a problem when attempting to implement a rotating border animation. In order to achieve this, I had to create a div encompassing all my content. The issue ar ...

Arrange the given data either by ID or Name and present it

Here is the code snippet I am working with: <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script> <style> .content{ border: 1px solid gray; width: 250px; ...

What about CSS block elements that have a width relative to their parent container

My goal is to create a layout where each h3 and p element is wrapped in a box. The current issue I'm facing is that the blocks extend to full width due to h3 and p being block level elements. The desired outcome is for the width of the boxes to adjus ...

Trigger keydown and click events to dynamically update images in Internet Explorer 7

There is a next button and an input field where users can enter the page number to jump to a specific page. Each page is represented by an image, like: <img src="http://someurl.com/1_1.emf" > // first page <img src="http://someurl.com/2_1.emf" ...

Rotate the circular border in a clockwise direction when clicked

I have successfully designed a heart icon using SVG that can be filled with color upon clicking. Now, I am looking to add an outer circle animation that rotates clockwise around the heart as it is being created. Currently, the circle only spins in the code ...

Is there a way to switch out the WordPress page title for an image instead?

I am trying to change up the appearance of my WordPress site by replacing the text on page titles with images. Working on a child theme locally, I need to customize each page individually as they will have different images. The current state is as follows ...

Utilizing Bootstrap to display side by side images at full height

Can someone help me achieve the layout shown in the image below? I want a container that spans full width and height with 2 images and other elements inside. The images should be full-height within the container, but also automatically adjust their width t ...

Enhance the Bootstrap Sass by integrating a color scheme that seamlessly complements all elements such as backgrounds, text, and borders throughout the

Hi there, I'm having an issue with Bootstrap and Sass when trying to add new colors to my theme map. Can anyone help me figure out what I might be doing wrong? Thank you in advance. I've been attempting to include a new color in the theme-colo ...

TaffyDB is throwing an error message indicating that TAFFY is not recognized as a function

I am currently developing a web-based game using HTML, CSS & JavaScript within Visual Studio and utilizing TaffyDB as my database. However, I have encountered an error when trying to create a database using the TAFFY function, as it keeps showing up in the ...

Utilizing aria-expanded="true" for modifying a CSS attribute: A simple guide

I am looking to utilize aria-expanded="true" in order to modify a css property such as an active class : <li class="active"> <a href="#3a" class="btn btn-default btn-lg" data-toggle="tab" aria-expanded="true"> <span class="networ ...

Attempting to retrieve an image from a specified div ID within Android Studio

I find myself at a loss for where to even begin with this issue, so I've been stumbling through it. While I've come across some similar posts, I haven't had any success in making them work. My goal is to utilize the div id to retrieve a spe ...

unable to locate the nearest available table

This is my HTML code: <div id="dvUser"> <table id="tblUser" > <tbody> <tr> <td> <input class="sfCheckBox" type="checkbox" title="view" checked="checked"> </td> </tr> <tr> <td> <input class="sf ...

Unable to successfully import an external HTML file that contains a script tag

I am currently experiencing an issue with my index.html <!doctype html> <html lang="en"> <head> <meta charset="utf-8> <title>MyApp</title> <link rel="import" href="./common.html"> </head> <body> ...

Setting predefined data in an HTML field from XML within the Odoo platform

In the model.py file of my project, I have defined an HTML field as follows: from odoo import models, fields class TestModel(models.model): _name = 'test.model' content = fields.HTML() To display the data from this model, I have used &l ...

The hyperlink for making phone calls appears twice on an Android phone

When you click on the number, it will be displayed twice in the phone screen like this... 12345678910,12345678910 ...instead of just once... 12345678910 Take a look at the code snippet below: {#if order.salesRep} <div class="info"> ...

Adjust the cursor in a contenteditable division on Chrome or Webkit

Is there a way to set the caret position in a contenteditable div layer? After trying different methods and doing some research online, I finally found a solution that works in firefox: function set(element,position){ element.focus(); var range= w ...