Reputation: 87
I am wondering how to make a border around a unordered list and just around the list. kinda like a box.
Upvotes: 0
Views: 28502
Reputation: 162
The code below can help you to create a table structure with a list.
ul{
list-style-type: none;
margin-top:0;
padding-left: 0;
border: 1px solid orangered;
}
li:not(:last-child){
border-bottom: 1px solid orangered;
}
}
<body>
<div>
<ul>
<li>Test1</li>
<li>Test2</li>
<li>Test3</li>
</ul>
</div>
</body>
Upvotes: 0
Reputation: 328
There is 2 ways you can go about this. You can put a ul selector like shown in the other example, or just put that in a , kind of like a container. Then just edit it with height and width. But I'll stick with sense thats what you asked for. Below is some code.
ul {
border: 1px solid black;
padding-right: 0px;
padding-left: 28px;
width: 50px;
border-radius: 5px;
}
<ul>
<li>Hello</li>
<li>Hello</li>
<li>Hello</li>
</ul>
let me know if you have any other questions on this!
Upvotes: 1
Reputation: 1333
ul{
display:inline-block;
border:1px solid #000;
padding:20px;
}
<ul>
<li>hey</li>
<li>hey</li>
<li>hey</li>
</ul>
that should do the trick! :)
i've edited my answer... now its just around the list items... not 100%
Upvotes: 6