Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lernen 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

War alles klar?

Wie können wir es verbessern?

Danke für Ihr Feedback!

Abschnitt 1. Kapitel 2

Fragen Sie AI

expand

Fragen Sie AI

ChatGPT

Fragen Sie alles oder probieren Sie eine der vorgeschlagenen Fragen, um unser Gespräch zu beginnen

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

Swipe um das Menü anzuzeigen

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

War alles klar?

Wie können wir es verbessern?

Danke für Ihr Feedback!

Abschnitt 1. Kapitel 2
some-alt