Open In App

How to set the list-item marker appear inside the content flow in CSS ?

The task is to set the list-item marker to appear inside the content flow in CSS. To specify the type of list item marker you can use the list-style-type and list-style-position property. Content flow is the set of rules that defines which element comes before another one, which one sits on top of another one etc. 

Syntax –



list-style-position: value;

Where value is –

Approach –



Example: In this example, we are using the above-explained approach.




<!DOCTYPE html>
<html>
<head>
    <style type="text/css">
        body {
            font-size: 20px;
            text-align: center;
        }
 
        ul.x {
            list-style-position: inside;
            background-color: lightgreen;
            list-style-type: square;
        }
 
        ul.y {
            list-style-position: outside;
            list-style-type: square;
            background-color: lightgreen;
        }
    </style>
</head>
 
<body>
    <h1 style="color:green">GeeksForGeeks</h1>
 
    <p>List-style-position: inside</p>
 
    <ul class="x">
        <li>Database</li>
        <li>Computer Network</li>
        <li>Operating System</li>
    </ul>
 
    <p>List-style-position: outside</p>
 
    <ul class="y">
        <li>Database</li>
        <li>Computer Network</li>
        <li>Operating System</li>
    </ul>
</body>
</html>

Output :


Article Tags :