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 purpose of the <datalist> element?What is the purpose of the <datalist> element?Mar 21, 2025 pm 12:33 PM

The article discusses the HTML <datalist> element, which enhances forms by providing autocomplete suggestions, improving user experience and reducing errors.Character count: 159

What is the purpose of the <progress> element?What is the purpose of the <progress> element?Mar 21, 2025 pm 12:34 PM

The article discusses the HTML <progress> element, its purpose, styling, and differences from the <meter> element. The main focus is on using <progress> for task completion and <meter> for stati

What is the purpose of the <meter> element?What is the purpose of the <meter> element?Mar 21, 2025 pm 12:35 PM

The article discusses the HTML <meter> element, used for displaying scalar or fractional values within a range, and its common applications in web development. It differentiates <meter> from <progress> and ex

What is the purpose of the <iframe> tag? What are the security considerations when using it?What is the purpose of the <iframe> tag? What are the security considerations when using it?Mar 20, 2025 pm 06:05 PM

The article discusses the <iframe> tag's purpose in embedding external content into webpages, its common uses, security risks, and alternatives like object tags and APIs.

What is the viewport meta tag? Why is it important for responsive design?What is the viewport meta tag? Why is it important for responsive design?Mar 20, 2025 pm 05:56 PM

The article discusses the viewport meta tag, essential for responsive web design on mobile devices. It explains how proper use ensures optimal content scaling and user interaction, while misuse can lead to design and accessibility issues.

How do I use HTML5 form validation attributes to validate user input?How do I use HTML5 form validation attributes to validate user input?Mar 17, 2025 pm 12:27 PM

The article discusses using HTML5 form validation attributes like required, pattern, min, max, and length limits to validate user input directly in the browser.

What are the best practices for cross-browser compatibility in HTML5?What are the best practices for cross-browser compatibility in HTML5?Mar 17, 2025 pm 12:20 PM

Article discusses best practices for ensuring HTML5 cross-browser compatibility, focusing on feature detection, progressive enhancement, and testing methods.

How do I use the HTML5 <time> element to represent dates and times semantically?How do I use the HTML5 <time> element to represent dates and times semantically?Mar 12, 2025 pm 04:05 PM

This article explains the HTML5 <time> element for semantic date/time representation. It emphasizes the importance of the datetime attribute for machine readability (ISO 8601 format) alongside human-readable text, boosting accessibilit

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

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft