I am trying to make a list like this picture, but I think I can’t get it right.
I was able to bold only the list but I couldn’t bold the number generated by using , also I want to know how to get the exact result on like on the picture.
Here is my code :
<!DOCTYPE html>
<html lang="en">
<head>
<title>Pertemuan 03</title>
<style>
body {
font-family: sans-serif;
}
h4 {
text-decoration: underline;
}
.italic {
font-style: italic;
}
ul li,
ol li {
text-indent: 20px;
padding-bottom: 3px;
}
</style>
</head>
<body>
<h4>Menu:</h4>
<ol>
<li>
<b>Makanan:</b>
<ol type="A">
<li>Nasi Kuning</li>
<li>Nasi Uduk</li>
<li>Nasi Goreng</li>
</ol>
</li>
<li>
<b>Lauk:</b>
<ul type="disc">
<li>Tahu Goreng</li>
<li>Tempe Goreng</li>
<li>Orek Tempe</li>
<li>Cah Kangkung</li>
</ul>
</li>
<li>
<b>Sayur:</b>
<ol type="a">
<li>Sayur Asem</li>
<li>Soto Ayam</li>
<li>Sop Iga Sapi</li>
</ol>
</li>
<li>
<b>Minuman:</b>
<ol type="A">
<li>
<i>Minuman Dingin:</i>
<ol type="i">
<li>Es Teh Manis</li>
<li>Es Jeruk</li>
<li>Es Campur</li>
</ol>
</li>
<br>
<li>
<i>Minuman Panas:</i>
<ol type="i">
<li>Kopi Hitam</li>
<li>Lemon Tea</li>
<li>Hot Chocolate</li>
</ol>
</li>
</ol>
</li>
</ol>
</body>
</html>
I am sorry if this question are confusing, because i cant explain it well
4
Answers
Style the
::marker
and reset the::marker
in the sub-menus.Alternatively, you don’t need the
<b>
tags at all. Just reset thefont-weight
on the submenus.Now this code displays exactly the same as your picture
you can use Marker :::
The
:: Marker
CSS Pseudo-Element Selects The Marker Box of a List Item, which type of contains a bullet or number. IT WORKS on Any Element or Pseudo-Element Set toDisplay: List-Item
, Such As TheThe
marker
sees all the list-styles of your list.Hope this answer has been useful to you.
To achieve the exact formatting as shown in the picture, you can modify your HTML code by adding some additional CSS styling. Below is the updated code with the necessary modifications:
I made a
.list-number
class containing the list numbers to the elements.I applied a CSS style to the list-number class to make the numbers bold and add a margin between the number and the list item text. This should give you the desired formatting for your list items, including bold numbers as shown in the picture.
Sorry if I didn’t answer it right but according to your question and my understanding, I think this should be the right answer…