Unable to use CSS to style an unordered list as a navbar

horizontal navigation bar css
list-style-type
how to change text color in navigation bar css
custom bullet points css
horizontal list css
css navigation bar with logo
navbar background color css
navbar styles

.navbar {
    background-color: 595959;
    color: #ffffff;
    list-style: none;
}
<ul class = "navbar"> 
    <li><a href = "#">Home</a></li>
    <li><a href = "#">About Us</a></li>
    <li><a href = "#">Our Projects</a></li>
    <li><a href = "#">Contact Us</a></li>
    <li><a href = "#">Donate</a></li>
</ul>

Here we go please dot his like this to archive style for removing the bullets use list-style-type:none; and of you do not want to use flex property you can simply use .navbar > li{display:inline-block;}

.navbar {
    background-color: 595959;
    color: #ffffff;
    list-style: none;
    display:block;
}

.navbar{display:flex; list-style-type:none;}
.navbar li{display:block; padding:15px;   border:1px solid #000;  color:#fff; }
.navbar li a{width:100%; text-align:center; color:#000;  text-decoration:none; }
.navbar2P{list-style-type:none;}
.navbar2 li{display:inline-block; }
.navbar2 li a{display:block; border:1px solid #000; color:#000; padding:15px 5px; text-decoration:none; }
<ul class = "navbar" > 
    <li><a href = "#">Home</a></li>
    <li><a href = "#">About Us</a></li>
    <li><a href = "#">Our Projects</a></li>
    <li><a href = "#">Contact Us</a></li>
    <li><a href = "#">Donate</a></li>
</ul>

<ul class = "navbar2" > 
    <li><a href = "#">Home</a></li>
    <li><a href = "#">About Us</a></li>
    <li><a href = "#">Our Projects</a></li>
    <li><a href = "#">Contact Us</a></li>
    <li><a href = "#">Donate</a></li>
</ul>

Unable to remove bullet points in CSS navigation bar, You have list-style-type in the .menu class tag which is a div (list-style-type is a style for <li> tags not divs). change li {float: left; }. to li {float: left  Simply fixed, add a class to your unordered list, then change your CSS to use that class. – mattytommo Dec 4 '12 at 21:51 You probably want to add an id to your HTML, or create a class and apply the class to your HTML.

Taken from this post:

You can remove bullets by setting the list-style-type to none on the CSS for parent element (typically a ), for example:

ul {
  list-style-type: none;
}

You might also want to add padding: 0 and margin: 0 to that, if you want to remove indentation as well.

See Listutorial for a great walkthrough of list formatting techniques.

Hope this helps!

Can't style navigation bar directly without styling all list items on , It's interactive, fun, and you can do it with your friends. Can't style navigation bar directly without styling all list items on page HELP! to learn how to greater select all my links in my navigation bar for styling in CSS efficiently and effectively​. I've made a unordered list,and the only way I can style them is if I enter li{styles​…}. Learn how create an unordered list without bullets, using CSS. How To Create a List Without Bullets The list-style-type:none property can be used to remove the default markers/bullets in a list.

Just add another CSS class:

ul {
  list-style: none;
{

WebD2: Stylizing a Navigation Menu with CSS, you will be able to use a variety of CSS properties to make an unordered list Then, all styles related to the navigation menu will go after this comment. The navigation menu is contained within the nav element, but that's just a container. The next step is to redefine the Unordered List tag style to get rid of the bullets and the indenting. Choose Text > CSS Styles > New and then select the Advanced radio button. In the Selector field, enter #navbar ul (Note, you must type this exactly as #style name, space, tag name with no punctuation after the tag.)

You should have the result you need if you add:

display: block;
position: relative;

If it doesn't help - please make some sandbox in jsfiddle or alike resource and give a link, let's see what's wrong.

If you need to style li and a elements, you need to write as well, for example:

.navbar li{
list-style: none;
padding: 1vw 2%;
}
.navbar li a{
text-decoration: none;
}

Navigation in Lists: To Be or Not To Be, And if we continue to use lists, why is it always an unordered list? I remember And you can't get to the sub nav as it disappears when you leave the parent link. Instead of navigation, you should see a fairly long nested unordered list at the top of the page. Let's fix that. CSS. First let's set the default font for the page (I know, I know—not exciting, but this is just a demo): html { font-family: Verdana, sans-serif; font-size: 16px; } And now here's the CSS for the overall list:

Turning a list into a navigation bar, The id attribute for the ul element is used by the CSS rules that style the entire list. The li elements have different id values to enable the use of  Unordered HTML List - Choose List Item Marker. The CSS list-style-type property is used to define the style of the list item marker. It can have one of the following values

Starting with HTML + CSS, Site navigation menu --> <ul class="navbar"> <li><a href="index.html">Home page</a> So far it contains the title of the document, but later we will add the CSS style Of the tags in the example, <ul> introduces an “Unordered List”, i.e., a list in also fine, and if all else fails, the browser may use any other font with serifs. Reinhard suggests not using lists for navigation, and instead using divs and spans. Leah Vogely was at the event and writes: I think everyone in the room scratched their heads when this was said. One of the first things you’re taught about coding is how to structure a navigation and this is normally done with an unordered list.

Beginning CSS3, browser to replace the default symbol with redsquare.png, but to display a standard square symbol if the image can't be found or images are turned off: ul { list-style: list-style-type: square; } Creating a Navigation Bar from a List Several years CSS has made life a lot easier, because you can often use image elements as  How to create a drop-down navigation menu with CSS. A unique and attractive navigation menu is important for every website. Navigation menus are critical for the superb accessibility of your website. Users like well-designed websites.

Comments
  • of course the code i have included is not together on a html file. i have imported my stylesheet and the css code is in the stylesheet which is definitely imported into the index.html file correctly.
  • You can start with ul.navbar li { display: inline-block; }
  • or maybe your stylesheet link is incorrect or has the wrong path, maybe absolute v. relative, but you're not showing that. <link rel="stylesheet" type="text/css" href="/path/to/your.css">
  • if you think this is helpful please mark my answer as accepted one
  • i have added another navbar in my code please check it it will help you more .