Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Apprendre Multiple Properties and Comments | Getting Started with CSS
CSS Foundations

bookMultiple Properties and Comments

index.html

index.html

style.css

style.css

copy

When you want to style an element with more than one visual property, you include multiple property-value pairs inside a single rule block. Each property is written on its own line, followed by a colon, the value, and a semicolon. For example, you can set the background-color, color, padding, and border-radius all within the same selector’s curly braces. This makes your CSS concise and easy to read.

To make your stylesheets even clearer, you can add comments within your CSS. Comments are useful for explaining the purpose of a rule or reminding yourself why you chose certain values. In CSS, a comment starts with /* and ends with */. Anything between these markers will be ignored by the browser and will not affect your styles.

question mark

Which of the following is the correct way to write a comment in CSS?

Select the correct answer

Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 1. Chapitre 2

Demandez à l'IA

expand

Demandez à l'IA

ChatGPT

Posez n'importe quelle question ou essayez l'une des questions suggérées pour commencer notre discussion

Suggested prompts:

Can you show me an example of a CSS rule with multiple properties?

How do I write a comment in CSS?

Why is it important to use comments in CSS?

Awesome!

Completion rate improved to 6.67

bookMultiple Properties and Comments

Glissez pour afficher le menu

index.html

index.html

style.css

style.css

copy

When you want to style an element with more than one visual property, you include multiple property-value pairs inside a single rule block. Each property is written on its own line, followed by a colon, the value, and a semicolon. For example, you can set the background-color, color, padding, and border-radius all within the same selector’s curly braces. This makes your CSS concise and easy to read.

To make your stylesheets even clearer, you can add comments within your CSS. Comments are useful for explaining the purpose of a rule or reminding yourself why you chose certain values. In CSS, a comment starts with /* and ends with */. Anything between these markers will be ignored by the browser and will not affect your styles.

question mark

Which of the following is the correct way to write a comment in CSS?

Select the correct answer

Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 1. Chapitre 2
some-alt