Home html fat point at the list elements in CSS

fat point at the list elements in CSS

Author

Date

Category

How to make a point of oily and change its color in the list item using CSS


Answer 1, Authority 100%

Suppose there is such a layout:

& lt; ul & gt;
  & lt; li & gt; element & lt; / li & gt;
& lt; / ul & gt;

option A

/ * remove the standard output of the list label * /
UL {
  List-Style-Type: None;
}
/ * It is necessary to specify the height of the string and positioning * /
UL Li {
  Font-Size: 18px;
  Line-Height: 18px;
  Position: relative;
}
UL LI :: BEFORE {
  Color: Crimson;
  / * UTF-8 Escape Sequence corresponding to the "list marker" * /
  Content: "\ 2022";
  / * Make more than the main text in Li * /
  Font-Size: 26px;
  font-weight: 700;
  / * Element is cut out of the stream, align the negative indent * /
  Left: -15px;
  / * Line height and positioning are necessary for vertical alignment * /
  Line-Height: 18px;
  Position: Absolute;
  Top: 0;
}

View Example a


option b

to use a predetermined picture as a marker

option in

If the list items are not longer than one line:

ul li {
  Color: Red;
  Font-Size: 26px;
}
UL LI: First-Line {
  Color: Black;
  Font-Size: 18px;
}

View Example in

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions