Get the App
SLTechnology News&Howtos  ›  Development  › 

How to set the same line of words in different formats by css

Shulou Source: shulou.com Published: 2022-06-02 07:14:26 10月03日 Update

This article mainly explains how css sets the same line of words in different formats. Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "css how to set the same line of words in different formats"!

Methods: 1, the use of span tags will need to change the format of the text wrapped, the syntax is "specified text"; 2, the use of selector to select the specified span tag elements, and set a different style, the syntax is "span object {css attribute, attribute value;}".

The operating environment of this tutorial: windows10 system, CSS3&&HTML5 version, Dell G3 computer.

How to set the same line of words in different formats by css

In css, if you want to format the same line differently, you can use the span tag to wrap the text that needs to be reformatted.

Tags are used to combine inline elements in a document. The specified text is then formatted by selecting the specified span tag element.

The HTML element is an inline element that can be used as a container for text.

The element also has no specific meaning.

When used with CSS, elements can be used to set style properties for parts of the text.

Examples are as follows:

Document. One {font-family: "italic";} .two {font-family: "Arial";} .three {color:red;}

This paragraph of text, the use of italics, Song style and other different formats, but also can change the color.

Output result:

At this point, I believe you have a deeper understanding of "how css sets the same line of words in different formats". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Tags: Format element different text line label attribute content package Arial method style italics grammar learning practical deeper composition text interest Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB Redmi Shulou Technology macOS Docker