I have an unordered list (
) with various number of items () in it. I want to use one CSS styling that allows the items to stretch t
Easy solution with
ul {
display: flex;
}
ul li {
width: 100%;
}
#ul1 {
display: block;
padding: 0;
list-style: none;
}
li-Class{
width: 100%
}
Note: display can be inline-block with width:100% and this code is for those who are looking to arrange li block wise.
Demo HI now you can do this
Used to display :table
and display:table-cell
as like this
Css
ul {
border:1px dotted black;
padding: 0;
display:table;
width:100%;
box-sizing:border-box;
-moz-box-sizing:border-box;
-webkit-box-sizing:border-box;
}
li {
background-color: red;
display:table-cell;
}
li:nth-child(2n) {
background-color: #0F0;
}
Now define your parent display:table;
or width:100%;
and define your child display:table-cell;
Demo
I've got the simplest solution.
<ul style="padding: 0;">
<li style="list-style-type: none;margin:0;"></li>
</ul>