Ul marker color. Add bullets or numbering to text. Create your own markers
There are two popular ways to change the color of bullets to be different from the text color.
Usage
Inside each element
create a design
In this case, the color of the markers is determined by the color style property for the li selector, and the text color is determined by the span selector (example 1).
Example 1: Using Nested Tags
- Violin
- Guitar
- Bagpipes
- Organ organ
- Celesta
The result of this example is shown below (Figure 1).
Rice. 1. Markers that differ in color from the main text
Despite its simplicity, the method is inconvenient, especially with voluminous lists, because now you will have to add to each list item .
Usage::before
The point is this: we remove the original list markers via the list-style-type property and add our own markers using the ::before pseudo-element and the content property. This link allows you to insert any text or symbol before an element, in this case
Example 2: Using the ::before pseudo-element
- North
- South
- West
- East
The result of this example is shown in Fig. 2.
This tutorial article will focus on working with lists in CSS, you will learn how to change the type of bullet, the location of the bullet relative to the list item, create your own bullets, and even change the color of the bullet.
I think you already know that HTML 5 uses two main types of lists (excluding description lists and menu items):
- numbered (ordered) list – HTML element
- bulleted (unordered) list – HTML element
CSS gives us a lot of options for formatting the appearance of these lists, let's look at the main ones.
Changing the marker type
The first property that I would like to consider is this property list-style-type , this specifies the type of the list item's marker.
Navigation menus, for example, are often made up of regular bulleted lists (HTML element
- ), by default the marker of which is displayed in the form of a filled circle, to remove it you need to use the CSS property list-style-type with the value none :
ul( list-style-type : none ; /* remove the marker from the list */
}
- List item
- List item
- List item
- List item
- List item
- List item
- List item
- List item
- List item
- List item
- List item
- List item
- List item
- List item
- List item
- List item
- List item
- List item
- List item
- List item
- List item
- List item
- List item
- List item
- List item
- List item
- List item
- List item
- List item
- List item
- List item
- List item
- List item
- List item
- List item
- List item
- List item
- List item
- List item
- List item
- List item
- List item
- List item
- List item
- List item
- List item
- List item
- List item
- List item
- List item
- List item
- List item
- List item
- List item
- List item
- List item
- List item
- List item
- List item
- List item
- List item
- List item
- List item
For bulleted (unordered) lists (HTML element
- ) there are three types of markers: in the form of a filled circle (disc is the default value), a marker in the form of a hollow circle (circle) and in the form of a square (square), and for numbered (ordered) lists (item
- ) all remaining options. The complete list is provided in the following table:
Meaning Description none The marker is not displayed. disc A marker in the shape of a filled circle. This is the default value. Armenian Numerical marker (traditional Armenian numbering). circle Marker in the shape of a circle. cjk-ideographic Simple ideographic numbers. decimal Numeric marker (decimal Arabic numbers starting with 1). decimal-leading-zero Numeric marker (decimal Arabic numbers starting with 1 and followed by a leading zero - 01, 02, 03...). georgian Numerical marker (traditional Georgian numbering - an, ban, gan, ..., he, tan, in, in-an...). hebrew Numerical marker (traditional Hebrew numbering). hiragana Numerical marker (Japanese Hiragana syllabary - a, i, u, e, o, ka, ki...). hiragana-iroha Numerical marker (Japanese syllabary Hiragana Iroha - i, ro, ha, ni, ho, he, to, ...). katakana Numeric marker (Japanese Katakana syllabary - A, I, U, E, O, KA, KI, ...). katakana-iroha Numeric marker (Japanese syllabary Katakana iroha - I, RO, HA, NI, HO, HE, TO, ...). lower-alpha Lowercase ascii letters (a, b, c, d...z). lower-greek Lowercase Greek letters (α, β, γ, δ, etc.). lower-latin Lowercase Latin letters (a, b, c, d,...z). lower-roman Roman numerals in lowercase (i, ii, iii, iv, v, etc.). square Marker in the shape of a square. upper-alpha Upper case ascii letters (A, B, C, D,...Z). upper-latin Capital Latin letters (A, B, C, D,...Z). upper-roman Roman numerals in uppercase (I, II, III, IV, V, etc.). Please note that the values hebrew , cjk-ideographic , hiragana , hiragana-iroha , katakana , katakana-iroha are not supported by the browser Internet Explorer .
Let's look at an example of using the list-style-type property in text:
Example of using the list-style-type property - /* list with the default marker type value (disc). */
- /* numbered list with marker type lower-roman */
- List item
- List item
- List item
- /* bulleted list with bullet type circle */
- List item
- List item
- List item
In this example, we created two styles, the first sets the marker type - lowercase Roman numerals (lower-roman value), we applied it to a numbered list (HTML element
- ), and to a bulleted list (HTML element
- ) to set your marker type, or create styles that will apply a specific marker to even or odd list elements, as seen in the following example:
Example of alternating styles of the list-style-type property - List item
- List item
- List item
- List item
- List item
- List item
- List item
- List item
In this example we have styled everything odd list elements - indicated the type of marker square, and the text color was indicated green. Even The list elements received the following style: red text color and absence marker.
The result of our example:
Position of the marker relative to the list item
The result of our example:
Rice. 71 An example of using the list-style-position property (the location of the marker / number in lists).
Create your own markers
Sooner or later you will need to create list markers with your own design, thanks to the CSS property list-style-image we can implement this desire in your project.
The property syntax is as follows:
ol( list-style-image : url("images/primer.png" ) ; /* specify the relative path to the image */ } ul( list-style-image : ; /* specify the absolute path to the image */ }The value in brackets corresponds to the path to the image that you plan to use as a marker. The path to the image can be either absolute or relative. When specifying a relative path, the important point is that it must be specified relative to the placement of the style sheet, not the page.
If you plan to design your own markers, then you will have to use a graphics editing program, or use ready-made sets. Please note that even if you did everything correctly, the image may not load on the page; in this case, you need to edit the image so that its background becomes transparent.
Let's look at an example of using custom markers in a document:
Example of using the CSS property list-style-image .test( list-style-image : url("http://site/images/mini5.png"); /* specify the absolute path to the image that will be used as a marker */ } - List item
- List item
- List item
- List item
- List item
- ) insert a pseudo-element (:before) generated content (CSS property content), which is identical in appearance to the marker in the bulleted list (HTML element
- ), only the color already necessary for our task.
- ). If this property is not applied in this case, the marker will be positioned close to the text, which is visually unsightly. Working with internal and external indents of elements will be discussed in detail in the next article of the textbook "".
Questions and tasks on the topic
Before moving on to the next topic, complete the practical tasks:
If you have difficulty completing the practice task, you can always open the example in a separate window and inspect the page to understand what CSS code was used.
2016-2019 Denis Bolshakov, you can send comments and suggestions on the site to [email protected]
You can use bulleted or numbered lists to organize text or show a sequential process in a PowerPoint presentation.
Changing the color and style of markers and understanding the limitations
You can change the color, style, or size of the bullets or numbers in your PowerPoint presentation, and you can also change the number you want to start with.
Apply custom styles to multiple slides
The best way to apply custom list styles to all slides in a presentation is to change the slide master. Any list settings you make to the slide master will be saved and applied to all slides. You can also edit or create one or more slide layouts that include custom list styles and add them to places in your presentation where you want to use your list styles.
List Limitations in PowerPoint
You can't do things with lists in PowerPoint that you can use in other Office programs, such as Word. For example, PowerPoint does not support the following features:
Questions and answers
Click the section title below for detailed instructions.
Why do I only see one marker no matter how many lines I add?
Make sure you are using text the field is markers or numbers, not a field titles. IN text field each time you press a key, a number or ENTER marker appears. When you press CTRL+ENTER, you get additional lines without bullets (for details or notes on a bulleted or numbered line).
In the field titles the text is expected to be a heading or title as one line. You can use numbers or bullets, but will count all lines of text as one line, resulting in one bullet or number.
How to cancel the creation of markers every time a line is added?
To stop creating bullets and numbers and return to the text, click markers or numbering again to disable it.
You can also press ENTER and press the BACKSPACE key to delete a marker or number. You can then add text or press Enter to add extra blank lines.
How to use multiple levels of markers?
To create a sublist within a list, place your cursor at the beginning of the line you want to indent, and then on the tab Home in the group paragraph click the button increase list level .
1 . Decrease list level (indent)
2 . Increase list level (indent)
To move text back to a lower level in the list, place the cursor at the beginning of the line and then on the tab Home in the group paragraph click the button reduce list level.
How can I increase or decrease the space between a bullet or number and the text on a line?
To increase or decrease the space between a bullet or number and the text on a line, place the cursor at the beginning of the line of text. To view the ruler, on the tab view in the group Show check the box ruler. On the ruler, click the tab (as shown in the image below) and drag the pointer to change the distance between the bullet or number and the corresponding text.
The ruler displays three different markers to indicate the indentation defined for the text field.
1 . First line indent - indicates the location of the actual bullet character or number. If a paragraph is not bulleted, this indicates the position of the first line of text.
2 . Left Indent - Adjusts the values of both the first line and indentation markers and maintains their relative spacing.
3 . protrusion - indicates the location of the actual lines of text. If a paragraph is not bulleted, it indicates the location of the second line (and subsequent lines) of text.
How can I change the default bullets to a different character?
To change the default bullets in PowerPoint on a Windows PC, follow these steps:
When you insert a slide or text box for bullets, new default bullet options will appear.
For more information about working with masters, see Change a slide master.
Use bullets or numbering to show a lot of text or sequential process in a Microsoft PowerPoint 2010 presentation.
CSS lists— a set of properties responsible for the design of lists. Using HTML lists is very common when creating website navigation bars. List items represent a collection of block elements.
Using standard CSS properties you can change the appearance of the list marker, add an image for the marker, and also change marker location. The height of the marker block can be set with the line-height property.
Designing lists using CSS styles
1. List marker type list-style-type
The property changes the marker type or removes the marker for bulleted and numbered lists. Inherited.
list-style-type Values: disc Default value. A filled circle acts as a marker for list items. Armenian Traditional Armenian numbering. circle An open circle acts as a marker. cjk-ideographic Ideographic numbering. decimal 1, 2, 3, 4, 5, … decimal-leading-zero 01, 02, 03, 04, 05, … georgian Traditional Georgian numbering. hebrew Traditional Hebrew numbering. hiragana Japanese numbering: a, i, u, e, o, … hiragana-iroha Japanese numbering: i, ro, ha, ni, ho, … katakana Japanese numbering: A, I, U, E, O, … katakana-iroha Japanese numbering: I, RO, HA, NI, HO, … lower-alpha a, b, c, d, e, … lower-greek Lowercase characters of the Greek alphabet. lower-latin a, b, c, d, e, … lower-roman i, ii, iii, iv, v, … none There is no marker. square A filled or unfilled square acts as a marker. upper-alpha A, B, C, D, E, … upper-latin A, B, C, D, E, … upper-roman I, II, III, IV, V, … initial Sets the property value to the default value. inherit Inherits the property value from the parent element. Syntax
Ul (list-style-type: none;) ul (list-style-type: square;) ol (list-style-type: none;) ol (list-style-type: lower-alpha;) Rice. 1. Example of designing bulleted and numbered lists
2. Images for list items list-style-image
You can use images and gradient fills as list item markers. Inherited.
Syntax
Ul (list-style-image: url("images/romb.png");) ul (list-style-image: linear-gradient(#FF7A2F 0, #FF7A2F 50%, #FFB214 50%);)
Rice. 2. Design a bulleted list using an image
Rice. 3. Design a bulleted list using a gradient3. List-style-position
This property provides the ability to place the marker outside or inside the content of the list item. Inherited.
CSS makes it possible to create bulleted and numbered lists, design bullet lists with images, and, if necessary, remove any bulleted list markings altogether.
CSS bullet list styles.
list-style-type
list-style-type: disc | circle | square | decimal | lower-roman | upper-roman | lower-alpha | upper-alpha | none ;
Meaning :
disk – bulleted list in the form of a filled circle
circle – bulleted list in the form of an unfilled circle
square – a bulleted list in the form of a filled square
decimal – numbered list with Arabic numbers (1,2,3, etc.)
upper-roman – numbered list in large Roman numerals (I, II, III, IV, etc.)
lower-roman – numbered list using small Roman numerals (i,ii,iii,iv, etc.)
upper-alpha – numbered list in capital letters (A,B,C, etc.)
lower-alpha – numbered list in lowercase letters (a,b,c, etc.)
none – no marker.
Example:
List properties in css - Believe in the best, expect the worst.
- Life is a disease, with a fatal outcome.
- Never say never.
Result :
There are cases when the display of a marker in the list needs to be removed. To do this, write in the CSS code
list-style-type: none;
Example:
List properties in css - Believe in the best, expect the worst.
- Never say never.
Result :
You can replace the usual markers in the list with your own images. This can be done using the list-style-image property.
list-style-image
list-style-image: url(image.png);
Example:
List properties in css - Believe in the best, expect the worst.
- Life is a disease with a fatal outcome.
- Never say never.
Result :
You can also set the distance of the bulleted list from the text. This can be done using the padding-left property on the li selector.
Example:
List properties in css - Believe in the best, expect the worst.
- Life is a disease with a fatal outcome.
- Never say never.
Result :
The next task is to change the color of the marker without changing the color of the text. How is this possible? The marker color can be changed by adding a tag to the test .
It looks like this: - text
- Believe in the best, expect the worst.
- Life is a disease with a fatal outcome.
- Never say never.
- Believe in the best, expect the worst. Point 1
- Life is a fatal disease. Point 2
- Never say never. Point 3
- That's all I knew. Point 4
Please note that in this example the padding-right property was used, which allowed us to make an internal indentation to the right in each list element (HTML element
Example:
List properties in css
Result :
Addition to the general topic.
If you need, for some reason, to set the numbering of the marker list not from zero, but, say, from 8, you can make this move.Example:
List properties in css
Result :
This topic has come to an end.
- ). If this property is not applied in this case, the marker will be positioned close to the text, which is visually unsightly. Working with internal and external indents of elements will be discussed in detail in the next article of the textbook "".
- ) we have applied a style that sets the marker type to be a hollow circle (value circle ).
The result of our example:
Please note that you can apply the list-style-type property even to a single list element (HTML element
In this example we specify absolute path to the image that will be used as a marker.
The result of our example:
Changing marker color in CSS
To wrap up this article, let's look at an advanced way to change the color of a marker without changing the color of the element, using the CSS content property and the previously discussed :before pseudo-element:
The essence of this method is that before each element of the list (HTML element