Hide bullet points using CSS
In this article, we will learn to hide the bullet points of a list in HTML. Developers can use HTML lists to display related items point by point.
We can <ol>
create ordered lists using the HTML tag and <ul>
unordered lists using the HTML <ul>
tag. Use default to create black circles for bullets, and similarly, use <ol>
default to create numbers for bullets.
Now, to set custom images or icons as bullet points, we need to hide the default bullet points, and that is what we will do in this article.
Hide default bullet points using custom CSS
Using CSS, we will only hide the points in the example below.
Here, we have created two lists of programming languages. One list is <ul>
an unordered list created using the <list> tag and the other is <ol>
an ordered list created using the HTML <list> tag.
Sample code:
<ul>
<li>JavaScript</li>
<li>HTML</li>
<li>CSS</li>
</ul>
<ol>
<li>Python</li>
<li>Node Js</li>
<li>Django</li>
</ol>
In the output below, users can see how the default bullet points look like.
Output:
To hide the default bullet points, we will apply list-style-type: none;
to the HTML list to hide the default bullet points.
In the code below, you can see that we have accessed all the list items using ul
the and ol
tags and changed their CSS.
ul li {
list-style-type: none;
}
ol li {
list-style-type: none;
}
In the output below, user can observe that the points for ordered and unordered lists are hidden.
Output:
Additionally, developers can use inline CSS to hide bullet points for specific list items. In the example below, we have created an unordered list and hidden the bullet points for certain items.
<ul>
<li style="list-style-type: none;">Jiyik</li>
<li>Netherlands</li>
<li style="list-style-type: none;">Germany</li>
</ul>
In the output below, the user can still see the bullet points for the Netherlands items, while the bullet points for the DelftStack and Germany items are hidden because we applied list-style type:none; using inline CSS.
Output:
In this article, we have seen how to eliminate the bullet points of all items. Also, we have seen the sample code with output to hide the bullet points of a specific list item.
For reprinting, please send an email to 1244347461@qq.com for approval. After obtaining the author's consent, kindly include the source as a link.
Related Articles
Rotating text using CSS
Publish Date:2025/04/19 Views:152 Category:CSS
-
In this article, we will use CSS to rotate HTML text. Rotated text is commonly used in many languages, such as Chinese, Japanese, or Korean. Moreover, when designing a web page, developers may need to rotate the text to a certain degree to
覆盖 Bootstrap CSS
Publish Date:2023/04/28 Views:136 Category:CSS
-
本文介绍的是著名的 CSS UI 框架 Bootstrap。 我们将讨论使用自定义样式覆盖 Bootstrap CSS 的过程。
使用 CSS 制作带圆角的 HTML 表格
Publish Date:2023/04/28 Views:247 Category:CSS
-
这个简短的文章是关于在 HTML 页面上制作圆角表格的 CSS 样式。使用 CSS 制作带圆角的 HTML 表格 使图像、表格或 div 段的角变圆的属性是 border-radius。
CSS 设置轮廓 outline 的半径
Publish Date:2023/04/28 Views:141 Category:CSS
-
在本文中,用户将学习如何为 outline 属性设置圆角,与 border-radius 属性相同。 在这里,我们已经解释了将圆角应用于轮廓属性的不同方法。
使用 CSS 居中视频
Publish Date:2023/04/28 Views:272 Category:CSS
-
在本文中,用户将学习仅使用 CSS 将 <video> 元素居中。 我们已经在下面解释了使用 CSS 使视频居中的多种方法。
使用 CSS 居中内联块
Publish Date:2023/04/28 Views:123 Category:CSS
-
在本文中,我们将创建多个 HTML 元素并将其显示设置为 inline-block。 之后,我们将学习使用 display: inline-block 将所有元素居中。
使用 CSS 添加透明边框
Publish Date:2023/04/28 Views:537 Category:CSS
-
在本文中,我们将讨论在 HTML 中的图像、按钮或任何其他对象周围创建透明边框。 透明边框是图像或对象周围的边框,可改善用户体验。
使用 CSS 向上移动文本
Publish Date:2023/04/28 Views:715 Category:CSS
-
有时,在开发网页时,我们将文本放在底部或页脚中,因此我们可能需要在文本下方留一个空格并将文本上移。 我们将学习如何使用 css 从网页底部向上移动文本。
使用 CSS 和 JavaScript 制作文本闪烁
Publish Date:2023/04/28 Views:244 Category:CSS
-
本文提供了使用 CSS、JavaScript 和 jQuery 使文本闪烁的详细说明。