So for my portfolio project i wanted to have a tool bar but i also wanted to use more than one set
of li/ul elements. Also this was done in code pen so i did import bootstrap and Jquery.
i am trying to use id’s but i am not sure if that is what i should be using. Any advice would help!
Write now the end result is kinda silly looking and if i don’t use the id’s and and just do
li {
code...ect
}
it will work but when trying to use id’s and calling custom classes it does not. Please help!
<ul id="ul-1">
<li id="li-1">< a id="a-1" href="default.asp">Home</a></li>
<li id="li-1">< a id="a-1" href="news.asp">News</a></li>
<li id="li-1">< a id="a-1" href="contact.asp">Contact</a></li>
<li id="li-1">< a id="a-1" href="about.asp">About</a></li>
</ul>
body{
background-color: #D3D3D3;
}
.ul-1{
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
background-color: #C0C0C0;
position: fixed;
top: 0;
width: 100%;
border: 2px solid #000;
}
.li-1{
border-right: 2px solid #ffffff;
float: left;
}
.a-1 {
display: block;
color: black;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
.a-1:hover {
background-color: #A9A9A9;
}
$(document).ready(function() {
$("#ul-1").addClass("ul-1");
$("#li-1").addClass("li-1");
$("#a-1").addClass("a-1");
});