Javascript examples for CSS Style Property:listStylePosition
The listStylePosition property sets or gets the position of the list-item marker.
Value | Description |
---|---|
outside | list-item marker is before text content. This is default |
inside | Indents the list-item marker marker |
initial | Sets this property to its default value. |
inherit | Inherits this property from its parent element. |
Item | Value |
---|---|
Default Value: | outside? |
Return Value: | A String, representing the position of the list-item marker |
CSS Version | CSS1 |
Get the list-item marker:
<!DOCTYPE html> <html> <body> <ul id="myList" style="list-style-position:inside;"> <li>Coffee</li> <li>Tea</li> <li>Water</li> <li>Soda</li> </ul>/*www .ja v a 2 s . c o m*/ <button type="button" onclick="myFunction()">Return list-item marker position</button> <script> function myFunction() { console.log(document.getElementById("myList").style.listStylePosition); } </script> </body> </html>