By default, the HTML UL element displays a bullet (•) in front of each LI list, and the OL element displays list items marked with numbers. This list-item markers can be removed, or replaced with other symbol /character, or with an image, using CSS properties.
The examples contain the CSS and HTML code in the same place, but you should add the CSS code in the <head> section of your HTML document, or in external '.css' file.
list-style: none;
to that UL /OL.
<style> ul.nobull, ol.nobull { list-style: none; } </style> <h4>Example removing bullets from lists</h4> UL list. <ul class='nobull'> <li>Free Courses and Tutorials</li> <li>CSS lessons</li> </ul><br> OL list. <ol class='nobull'> <li>https://CoursesWeb.net/</li> <li>https://marplo.net/</li> </ol>
list-style: none;
to that UL /OL. And set the :before
pseudo-class to the LI of that UL /OL, with the 'Hex code' for custom bullet to content
property (the symbol must be specified in Code Hex notation).
To this page: HTML Symbol Entities there are tables with various HTML code hex entities.
:before
pseudo-class you can set the color, size, and other styles for the custom bullet.
<style> ul.bull1, ol.bull2 { list-style: none; } ul.bull1 li:before { content: '\00BB'; /* code Hex notation */ padding-right: 8px; color:#0000be; } ol.bull2 li:before { content: '\272C'; /* code Hex */ padding-right: 8px; color:#00be00; } </style> <h4>Example lists with custom bullets</h4> UL list. <ul class='bull1'> <li>Free Courses and Tutorials</li> <li>CSS course</li> <li>CSS lessons</li> </ul><br> OL list. <ol class='bull2'> <li>https://CoursesWeb.net/</li> <li>https://marplo.net/</li> </ol>
<style> ul { list-style-image: url('image.jpg'); } </style>
list-style-type
property to that OL.start='index'
attribute in the OL tag.
<style> ol.numlatin { list-style-type: upper-latin; } ol.numdec { list-style-type: decimal-leading-zero; } </style> <h4>Example list-style-type to OL</h4> - Lists with upper latin letters. <ol class='numlatin'> <li>Free Courses and Tutorials</li> <li>Flash Games</li> <li>CSS lessons</li> </ol><br> - Starts the numbering from the 3rd index, with decimal leading zero. <ol class='numdec' start='3'> <li>MarPlo.net</li> <li>GamV.eu</li> <li>CoursesWeb.net</li> </ol>
list-style-type
property.list-style-position: inside;
property to UL /OL item.<style> ul.insbull, ol.insbull { list-style-position: inside; } ul li, ol li { border: 1px solid blue; } </style> <h4>Example list-style-position: inside</h4> - Default. <ul> <li>List 1</li> <li>List 2</li> </ul><br> - List-item markers inside the content flow. <ul class='insbull'> <li>Free Courses and Tutorials</li> <li>CSS course</li> <li>CSS lessons</li> </ul><br> <ol class='insbull'> <li>MarPlo.net</li> <li>CoursesWeb.net</li> </ol>
<ul> <li>http://coursesweb.net/html/</li> <li>http://coursesweb.net/css/</li> </ul>
.some_class { display: list-item; }
var obj = { "courses": ["php", "javascript", "ajax"] }; var jsonstr = JSON.stringify(obj); alert(jsonstr); // {"courses":["php","javascript","ajax"]}
$strhtml = '<body><div id="dv1">CoursesWeb.net</div></body>'; $dochtml = new DOMDocument(); $dochtml->loadHTML($strhtml); $elm = $dochtml->getElementById("dv1"); echo $elm->nodeValue; // CoursesWeb.net