Jump to content

How to add bullet points to li classes


newcoder1010

Recommended Posts

Hello,

 

I have this html:

<ul class="menu nav">
<li class="first leaf">           <a href="md1" class="parent-menu">ARLINGTON COUNTY, VA</a></li>
<li class="leaf parent-item1"><a href="md2" >AC C2</a></li>
<li class="leaf parent-item1"><a href="md3" >AC C1</a></li>
<li class="leaf"><a href="md4" >Prince George's County, MD</a></li>
<li class="leaf parent-item1"><a href="md5" >PG C2</a></li>
<li class="last leaf parent-item1"><a href="md6" >PG C1</a></li>
</ul>

----

How to add bullet points before each parent-item1 class as follows:

 

. AC C1

. AC C2

 

-----

I tried this code and it did not do anything.

.parent-item1 {list-style: square;}
Edited by newcoder1010
Link to comment
Share on other sites

I did inspect. I did see one element showing as list-style:none; I removed it and it still did not work.

 

Now, I have this instead. Still no luck.

.cities-we-serve-menu-block .parent-item1 {
    margin-left: 15px;
    display: list-item;
}

This is my page. If you could inspect please, it would help. Please scroll down and see on the right. Block title: CITIES WE SERVE.

Link to comment
Share on other sites

You haven't set the list-style-type property.

 

This works:

.cities-we-serve-menu-block .parent-item1 {
    margin-left: 15px;
    display: list-item;
    list-style-type: square;
}

You might have to adjust the margin and padding for the list item.

Link to comment
Share on other sites

Thank you.

 

I made some changes. How to indent the inner li classes(.child-menu-item)? I tried list-style-position: inside; and did not work. If I use margin-left, it only indents the text. I would like to indent the bullets as well.

.cities-we-serve-menu-block .menu li {
    display: list-item;
    list-style-type: square;
}
.cities-we-serve-menu-block .child-menu-item {
    margin-left: 55px;    list-style-position: inside;

}
Edited by newcoder1010
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...