Trivia:
琐事:
We all want our elements inside the web page to be in a particular order as it helps in displaying the web page in a sorted and well-arranged manner. The convention is to choose from various types of lists. There are majorly three types of lists: Ordered List, Unordered List, and Description List. People would select from one of these types and would start creating a list for the elements that they want to display in an arranged form.
我们所有人都希望网页中的元素具有特定的顺序,因为它有助于以有序排列的方式显示网页。 约定是从各种类型的列表中选择。 列表主要有三种类型: 有序列表 , 无序列表和描述列表 。 人们将从这些类型中选择一种,并开始为他们要以排列形式显示的元素创建一个列表。
Problem:
问题:
Lists generally come with numbering, bullets and various other patterns to point in every element or a sentence depending on what is inside the list. But there are times when developers do not want their elements inside the list to be pointed out or anything. So what to do when someone does not want any bullet points for their list?
列表通常带有编号,项目符号和各种其他样式,以根据列表中的内容指向每个元素或句子。 但是有时候开发人员不希望指出列表中的元素或其他任何内容。 那么,当某人不希望列表中有任何要点时该怎么办?
Solution:
解:
Let us suppose that a developer is creating an unordered list but he or she does not want any bullet points for that particular list. The answer is surprisingly very simple as the only thing you gotta do is add list-style-type in your unordered list. Let us understand this solution step by step.
让我们假设开发人员正在创建一个无序列表,但他或她不希望该特定列表有任何要点。 答案非常简单,因为您唯一要做的就是在无序列表中添加list-style-type 。 让我们逐步了解此解决方案。
Step 1: First, an unordered list is created with the help of the tag. Here ul stands for unordered list.
步骤1:首先,在
Step 2: For the list items, we use tag add li here means list items. These list items are generally marked with numbers, circles or discs. But the default is bullets, small black dots.
第2步:对于列表项,我们使用
Step 3: We will use CSS property list-style-type for creating an unordered list but omitting bullets and to that, we will be using the style attribute. We know that the style attribute defines or specifies an inline style for a particular element.
步骤3:我们将使用CSS属性list-style-type创建无序列表,但是省略了项目符号,为此,我们将使用style属性。 我们知道style属性为特定元素定义或指定了内联样式。
Step 4: We will be using this attribute with the HTML tag along with the CSS property list-style-type to omit the bullets in our unordered list.
步骤4:我们将使用此属性和HTML
Note: It is known that the usage of style attribute overrides any usage of style which is set globally. Therefore, the style attribute would override any style which is specified in the HTML tag or an external style sheet.
注意:众所周知,样式属性的使用会覆盖全局设置的任何样式的使用。 因此,样式属性将覆盖HTML