Contenu du cours
CSS Fundamentals
CSS Fundamentals
1. Getting Started with CSS
What is CSS and Why is it Important?Linking CSS to an HTML DocumentMastering CSS Selectors for Styling HTML ElementsChallenge: Apply Your First CSS StylesChallenge: Style with Class SelectorsEnhancing Styles with User Action Pseudo-ClassesChallenge: Apply User Action Pseudo-ClassesChanging Text Colors in CSSOptimizing Workflow for Efficient CSS CodingChallenge: Use Variables for Better CSS Management
3. The CSS Box Model & Spacing Elements
What is the CSS Box Model?Understanding Box Sizing in CSSAdding Space with Margins and PaddingChallenge: Apply Box Sizing to ElementsUsing Structural and Functional Pseudo-ClassesChallenge: Practice Structural Pseudo-ClassesUnderstanding Block, Inline, and Inline-Block ElementsWorking with Block-Level ElementsWorking with Inline ElementsChallenge: Predict Page Layout with Different Element Types
Challenge: Implement Decorative Effects in CSS
Task
Let's practice and enhance the visual appeal of the webpage. The task includes:
- Add a shadow to the
div
element with the class namecard
. The specified shadow values arergba(0, 0, 0, 0.3) 0px 19px 38px, rgba(0, 0, 0, 0.22) 0px 15px 12px
. - Add a background image to the
div
element with the class namecard
. The image link is provided:https://codefinity-content-media.s3.eu-west-1.amazonaws.com/code-1/css-fundamentals/decorative-effects/challenge-background.png
. - Center the background image within the card.
index.html
index.css
- To add a shadow to an element, utilize the
box-shadow
property with the specified value. In this case, the value isrgba(0, 0, 0, 0.3) 0px 19px 38px, rgba(0, 0, 0, 0.22) 0px 15px 12px
. - For setting an image as a background using the
background-image
property, employ theurl("correct path")
syntax. Inside the brackets, open quotes and specify the path to the image. In this task, the correct path is provided:url("https://codefinity-content-media.s3.eu-west-1.amazonaws.com/code-1/css-fundamentals/decorative-effects/challenge-background.png")
. - To determine the position of the background image, use the
background-position
property. In this scenario, set the value tocenter
for the property.
index.html
index.css
Tout était clair ?
Merci pour vos commentaires !
Section 5. Chapitre 6