search
HomeWeb Front-endHTML TutorialCommon properties of CSS1 and CSS2

This time I will bring you the common properties of CSS1 and CSS2. What are the precautions for using the common properties of CSS1 and CSS2? Here are practical cases, let’s take a look.

background Set all background properties in one statement.
background-attachment Set whether the background image is fixed or scrolls with the rest of the page.
background-color Set the background color of the element.
background-image Set the background image of the element.
background-position Set the starting position of the background image.
background-repeat Set whether and how to repeat the background image.
border Set all border properties in one statement.
border-bottom Set all bottom border properties in one statement.
border-bottom-color Set the color of the bottom border.
border-bottom-style Set the style of the bottom border.
border-bottom-width Set the width of the bottom border.
border-color Set the color of the four borders.
border-left Set all left border properties in one statement.
border-left-color Set the color of the left border.
border-left-style Set the style of the left border.
border-left-width Set the width of the left border.
border-right Set all right border properties in one statement.
border-right-color Set the color of the right border.
border-right-style Set the style of the right border.
border-right-width Set the width of the right border.
border-style Set the style of the four borders.
border-top Set all top border properties in one statement.
border-top-color Set the color of the top border.
border-top-style Set the style of the top border.
border-top-width Set the width of the top border.
border-width Set the width of the four borders.
outline Set all outline properties in one statement.
outline-color Set the color of the outline.
outline-style Set the style of the outline.
outline-width Set the width of the outline.
height Set the height of the element.
max-height Set the maximum height of the element.
max-width Set the maximum width of the element.
min-height Set the minimum height of the element.
min-width Set the minimum width of the element.
width Set the width of the element.
FONT Set all font attributes in one statement.
font-family Specifies the font family of the text.
font-size Specifies the font size of the text.
font-size-adjust Specifies the aspect value for the element.
font-stretch Shrink or stretch the current font family.
font-style Specifies the font style of the text.
font-variant Specifies whether to display text in small caps font.
font-weight specifies the thickness of the font.
content is used with :before and :after pseudo-elements to insert generated content.
counter-increment Increments or decrements one or more counters.
counter-reset Create or reset one or more counters.
quotes Set the quote type of nested quotes.
list-style Set all list properties in one statement.
list-style-image Set the image as the list item mark.
list-style-position Set the placement position of the list item mark.
list-style-type Set the type of list item tag.
margin Set all margin properties in one declaration.
margin-bottom Set the bottom margin of the element.
margin-left Set the left margin of the element.
margin-right Set the right margin of the element.
margin-top Set the top margin of the element.
padding Set all padding properties in one statement.
padding-bottom Set the bottom padding of the element.
padding-left Sets the left padding of the element.
padding-right Set the right padding of the element.
padding-top Set the top padding of the element.
bottom Set the offset between the bottom margin boundary of the positioned element and the bottom boundary of its containing block.
clear Specifies which side of the element does not allow other floating elements.
clip clips an absolutely positioned element.
cursor Specifies the type (shape) of the cursor to be displayed.
display Specifies the type of box that the element should generate.
float Specifies whether the box should float.
left                   Set the offset between the left margin boundary of the positioned element and the left boundary of its containing block.
overflow Specifies what happens when content overflows the element box.
position specifies the positioning type of the element.
right               Set the offset between the right margin boundary of the positioned element and the right boundary of its containing block.
top             Set the offset between the top margin boundary of the positioned element and the upper boundary of its containing block.
vertical-align Set the vertical alignment of the element.
visibility Specifies whether the element is visible.
z-index Set the stacking order of elements.
orphans ​ ​ Set the minimum number of lines that must remain at the bottom of the page when pagination occurs inside the element.
page-break-after Sets the paging behavior after the element.
page-break-before Set the paging behavior before the element.
page-break-inside Set the paging behavior inside the element.
Widows Settings must be retained at the minimum number of rows on the top of the page when the pagination occurs in the element.
border-collapse Specifies whether to merge table borders.
border-spacing Specifies the distance between adjacent cell borders.
caption-side Specifies the position of the table title.
empty-cells Specifies whether to display borders and backgrounds on empty cells in the table.
table-layout Set the layout algorithm used for tables.
color               Set the color of the text.
direction Specifies the direction/writing direction of the text.
letter-spacing Set character spacing.
line-height Set the line height.
text-align Specifies the horizontal alignment of text.
text-decoration Specifies the decorative effect added to the text.
text-indent specifies the indentation of the first line of the text block.
text-shadow Specifies the shadow effect added to text.
text-transform Control the case of text.
unicode-bidi Set the text direction.
white-space specifies how to handle whitespace in elements.
word-spacing Set word spacing.

I believe you have mastered the method after reading the case in this article. For more exciting information, please pay attention to other related articles on the php Chinese website!

Related reading:

JavaScript array-string-mathematical function

jquery’s DOM and events

The above is the detailed content of Common properties of CSS1 and CSS2. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
What is the root tag in an HTML document?What is the root tag in an HTML document?Apr 29, 2025 am 12:10 AM

TheroottaginanHTMLdocumentis.Itservesasthetop-levelelementthatencapsulatesallothercontent,ensuringproperdocumentstructureandbrowserparsing.

Are the HTML tags and elements the same thing?Are the HTML tags and elements the same thing?Apr 28, 2025 pm 05:44 PM

The article explains that HTML tags are syntax markers used to define elements, while elements are complete units including tags and content. They work together to structure webpages.Character count: 159

What is the significance of <head> and <body> tag in HTML?What is the significance of <head> and <body> tag in HTML?Apr 28, 2025 pm 05:43 PM

The article discusses the roles of <head> and <body> tags in HTML, their impact on user experience, and SEO implications. Proper structuring enhances website functionality and search engine optimization.

What is the difference between <strong>, <b> tags and <em>, <i> tags?What is the difference between <strong>, <b> tags and <em>, <i> tags?Apr 28, 2025 pm 05:42 PM

The article discusses the differences between HTML tags , , , and , focusing on their semantic vs. presentational uses and their impact on SEO and accessibility.

Please explain how to indicate the character set being used by a document in HTML?Please explain how to indicate the character set being used by a document in HTML?Apr 28, 2025 pm 05:41 PM

Article discusses specifying character encoding in HTML, focusing on UTF-8. Main issue: ensuring correct display of text, preventing garbled characters, and enhancing SEO and accessibility.

What are the various formatting tags in HTML?What are the various formatting tags in HTML?Apr 28, 2025 pm 05:39 PM

The article discusses various HTML formatting tags used for structuring and styling web content, emphasizing their effects on text appearance and the importance of semantic tags for accessibility and SEO.

What is the difference between the 'id' attribute and the 'class' attribute of HTML elements?What is the difference between the 'id' attribute and the 'class' attribute of HTML elements?Apr 28, 2025 pm 05:39 PM

The article discusses the differences between HTML's 'id' and 'class' attributes, focusing on their uniqueness, purpose, CSS syntax, and specificity. It explains how their use impacts webpage styling and functionality, and provides best practices for

What is the 'class' attribute in HTML?What is the 'class' attribute in HTML?Apr 28, 2025 pm 05:37 PM

The article explains the HTML 'class' attribute's role in grouping elements for styling and JavaScript manipulation, contrasting it with the unique 'id' attribute.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

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

Hot Tools

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool