Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What properties can be inherited in the CSS selector

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces the CSS selector can inherit the attributes of what the relevant knowledge, the content is detailed and easy to understand, the operation is simple and fast, with a certain reference value, I believe you can read this CSS selector can inherit the attributes of which articles will have a harvest, let's take a look at it.

If we want to set the CSS style in the HTML element, we need to control it through the CSS selector. In other words, the CSS selector is used to point to the tag to which the CSS style needs to be added, so that the CSS style knows which tag it needs to apply to.

The inheritance of CSS means that the tag wrapped inside will have the style of the external tag, that is, the child element can inherit the attributes of the parent element.

The following describes several commonly used selectors and their inheritable properties.

Common CSS selectors are:

Id selector

We set the id selector by setting the id property of the tag. The id selector in CSS is defined by #. Such as the following is the CSS style that sets id to "box". Add a style with a height of 100px, a width of 100px, and a red background color for div.

Class selector

A common selector is also a class selector. The class selector sets the style by setting the class property of the tag. The class selector in CSS is based on. To define. Such as the following is the CSS style that sets class to "box". Add a style with a height of 100px, a width of 100px, and a blue background color for div.

Tag selector

The tag selector sets the CSS style for a certain type of tag. Set the style directly with the label signature in CSS. Such as below is to set the CSS style of div. Add a style with a height of 100px, a width of 100px, and a pink background to the div.

Inline selector

We can also write CSS code directly inside the tag. By adding the style attribute, you can add CSS styles within the style.

Inheritable properties:

There are several inheritable properties in CSS.

Font Family Properties

Font

Combined font

Font-family

Specifies the font family of the element

Font-weight

Set the weight of the font

Font-size

Set the size of the font

Font-style

Define the style of the font

Font-variant

Set the font for small uppercase letters to display text, which means that all lowercase letters are converted to uppercase, but all letters that use small uppercase fonts have a smaller font size than the rest of the text.

Font-stretch

Allows you to make the text wider or narrower. All major browsers do not support it.

Font-size-adjust

Specify an aspect value for an element, and the ratio between the height of the lowercase "x" and the "font-size" height of a font is called the aspect value of a font. In this way, you can maintain the x-height of the preferred font.

Text series properties

Text-indent text indentation text-align text horizontal alignment line-height line height word-spacing increase or decrease white space between words (that is, word spacing) letter-spacing increase or decrease white space between characters (character spacing) text-transform controls text case direction specifies the writing direction of the text color text color

Element visibility

Visibility specifies whether the element is visible or not

Table layout Properties

Caption-side specifies the placement of table headings border-collapse sets the merged border model for the table border-spacing sets the distance between the borders of adjacent cells (for Border detach mode only) empty-cells sets whether to display empty cells in the table (for "detach borders" mode only) table-layout algorithm rules for displaying table cells, rows, and columns

List Properti

List-style-type sets the type of list item tag list-style-image uses an image to replace the list item's tag list-style-position sets where to place the list item tag list-style sets all list properties in one declaration

Generate content properties

Quotes sets the quotation mark type of nested references (embedded quotation)

Cursor Properti

Cursor specifies the type (shape) of the cursor to display

Page style Properties

Page retrieves or specifies the page type to use when displaying the object container

Page-break-inside sets the page-breaking behavior within an element orphans sets or returns the minimum number of visible lines that an element must be at the bottom of the page (for print or print preview)

Sound style Properti

Speak specifies whether the content will be presented in voice form speak-punctuation rules on how to pronounce punctuation speak-numeral rules on how to pronounce numerals speak-header specifies how to handle table titles. Should you read the title before each cell, or only before the cell whose title is different from the previous cell. Speech-rate prescribes the speed of speaking volume prescribes the volume of speech voice-family prescribes the family of sounds pitch prescribes the voice of pitch-range

Prescribe changes in pronunciation (monotonous or beautiful sound? ) stress

Specify the "pressure" richness in voice

Specifies the richness of the voice. Is the voice rich or thin? ) azimuth

Set the source elevation of the sound

Set the source of sound this article on "what properties can be inherited in the CSS selector" ends here, thank you for reading! I believe you all have a certain understanding of the knowledge of "what attributes can be inherited in the CSS selector". If you want to learn more, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report