I've been attempting to customize the width
and height
of the list element, but I'm encountering difficulties in doing so.
HTML :
<div class="myclass">
<ul>
<li style="background-color:green;"><span class="myspanclass">0</span></li>
<li class="liclass" style="background-color:green;">0</li>
</ul>
</div>
Style :
The following code works:
.myclass ul {list-style-type:none; padding: 0px;}
.myclass li {display: inline; margin-right: 10px;}
However, none of the following codes work as expected:
.myclass ul li {width:50px; height:50px;}
.myclass li {width:50px; height:50px;}
.liclass {width:50px; height:50px;}
.myspanclass {width:50px; height:50px;}
I am puzzled as to what is going wrong here. The li
element should have a green background color and be displayed as a square with dimensions of 50x50
, according to the defined CSS styles. Nevertheless, it is not displaying as intended.