Challenge: Style a Travel Destination Card
Swipe to show menu
Task
Style a travel destination card using external CSS and inline styles.
The component must include:
-
A wrapper
divelement. Apply thecardCSS class usingclassName. -
An image (
imgelement).srcattribute must be equal to theimageUrlvariable.altattribute must be equal toSantorini.- Apply the
card-imageCSS class.
-
A heading (
h2element).- Its text content must be
Santorini, Greece. - Apply the
titleCSS class.
- Its text content must be
-
A paragraph (
pelement).- Its text content must be
Beautiful sunsets, white houses, and crystal clear water.. - Apply inline styles using the
descriptionStylesobject.
- Its text content must be
-
The
descriptionStylesobject must include:colorequal to"#555".fontSizeequal to"18px".lineHeightequal to"1.5".
-
Import the
styles.cssfile into the component.
Starter Code
Open the starter project below and complete the missing parts of the component.
Everything was clear?
Thanks for your feedback!
Section 4. Chapter 4
Ask AI
Ask AI
Ask anything or try one of the suggested questions to begin our chat
Section 4. Chapter 4