What are the properties that can and cannot be inherited in CSS?
1. Non-inherited attributes
1. display: Specifies the type of box that the element should generate
2. Text attribute:
vertical-align: Vertical text alignment
text-decoration: Specifies the decoration added to the text
text-shadow: Text shadow effect
white-space: Treatment of whitespace characters
unicode-bidi: Setting the direction of text
3. Box model attributes
width, height, margin, margin-top, margin-right, margin-bottom、margin-left、border、border-style、border-top-style、border-right-style、border-bottom-style、border-left-style、border-width、border-top-width、border- right-right, border-bottom-width, border-left-width, border-color, border-top-color, border-right-color, border-bottom-color, border-left-color, border-top, border- right, border-bottom, border-left, padding, padding-top, padding-right, padding-bottom, padding-left
4, background attribute
background, background-color, background -image, background-repeat, background-position, background-attachment
5, positioning attribute
float, clear, position, top, right, bottom, left, min-width, min- height, max-width, max-height, overflow, clip, z-index
6, generate content attributes
content, counter-reset, counter-increment
7 , outline style attributes
outline-style, outline-width, outline-color, outline
8, page style attributes
size, page-break-before, page- break-after
9. Sound style attributes
pause-before, pause-after, pause, cue-before, cue-after, cue, play-during
two , Inherited attributes
1. Font family attributes
font: combined font
font-family: specifies the font family of the element
font- weight: Set the thickness of the font
font-size: Set the size of the font
font-style: Define the style of the font
font-variant: Set the font of small uppercase letters Displays text, which means that all lowercase letters are converted to uppercase, but all letters in small caps have a smaller font size compared to the rest of the text.
font-stretch: Stretch and transform the current font-family. Not supported by all major browsers.
font-size-adjust: Specify an aspect value for an element so that the x-height of the preferred font is maintained.
2. Text series attributes
text-indent: text indent
text-align: text horizontal alignment
line-height: line height
Word-spacing: Increase or decrease the space between words (i.e. word spacing)
letter-spacing: Increase or decrease the space between characters (character spacing)
text- transform: Control text case
direction: Specify the writing direction of text
color: Text color
3. Element visibility
visibility
4. Table layout properties
caption-side, border-collapse, border-spacing, empty-cells, table-layout
5. List layout properties
list-style-type, list-style-image, list-style-position, list-style
6, generated content attribute
quotes
7, cursor attribute
cursor
8. Page style attributes
page、page-break-inside、windows、orphans
9、Sound style attributes
speak、speak-punctuation、speak-numeral、speak-header、speech-rate、volume、voice-family、pitch、pitch-range、stress、richness、azimuth、elevation
3. All elements can Inherited properties
1. Element visibility
visibility
2. Cursor property
cursor
4. Inline elements can Inherited properties
1. Font family properties
2. Text series properties except text-indent and text-align
5. Block-level elements can be inherited Attribute
1, text-indent, text-align
The above is the detailed content of What are the properties that can and cannot be inherited in CSS?. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



Using Bootstrap in Vue.js is divided into five steps: Install Bootstrap. Import Bootstrap in main.js. Use the Bootstrap component directly in the template. Optional: Custom style. Optional: Use plug-ins.

HTML defines the web structure, CSS is responsible for style and layout, and JavaScript gives dynamic interaction. The three perform their duties in web development and jointly build a colorful website.

There are two ways to create a Bootstrap split line: using the tag, which creates a horizontal split line. Use the CSS border property to create custom style split lines.

WebdevelopmentreliesonHTML,CSS,andJavaScript:1)HTMLstructurescontent,2)CSSstylesit,and3)JavaScriptaddsinteractivity,formingthebasisofmodernwebexperiences.

There are several ways to insert images in Bootstrap: insert images directly, using the HTML img tag. With the Bootstrap image component, you can provide responsive images and more styles. Set the image size, use the img-fluid class to make the image adaptable. Set the border, using the img-bordered class. Set the rounded corners and use the img-rounded class. Set the shadow, use the shadow class. Resize and position the image, using CSS style. Using the background image, use the background-image CSS property.

To set up the Bootstrap framework, you need to follow these steps: 1. Reference the Bootstrap file via CDN; 2. Download and host the file on your own server; 3. Include the Bootstrap file in HTML; 4. Compile Sass/Less as needed; 5. Import a custom file (optional). Once setup is complete, you can use Bootstrap's grid systems, components, and styles to create responsive websites and applications.

To adjust the size of elements in Bootstrap, you can use the dimension class, which includes: adjusting width: .col-, .w-, .mw-adjust height: .h-, .min-h-, .max-h-

How to use the Bootstrap button? Introduce Bootstrap CSS to create button elements and add Bootstrap button class to add button text
