Instantly share code, notes, and snippets.
Created
September 6, 2021 13:25
-
Star
0
(0)
You must be signed in to star a gist -
Fork
0
(0)
You must be signed in to fork a gist
-
Save loloof64/0a4733752cdd1c724697badb1e5de3d9 to your computer and use it in GitHub Desktop.
CSS course Udemy exercise (flexbox)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#product-overview { | |
background: linear-gradient(to top, rgba(80, 68, 18, 0.6) 10%, transparent), | |
url("images/freedom.jpg") center/cover no-repeat border-box, | |
#ff1b68; | |
/* background-image: url("freedom.jpg"); | |
background-size: cover; | |
background-position: left 10% bottom 20%; */ | |
/* background-repeat: no-repeat; | |
background-origin: border-box; | |
background-clip: border-box; */ | |
/* background-image: linear-gradient(180deg, red 70%, blue 60%, rgba(0,0,0,0.5)); */ | |
/* background-image: radial-gradient(ellipse farthest-corner at 20% 50%, red, blue 70%, green); */ | |
width: 100vw; | |
height: 33vh; | |
/* border: 5px dashed red; */ | |
position: relative; | |
} | |
#product-overview h1 { | |
color: white; | |
font-family: "Anton", sans-serif; | |
position: absolute; | |
bottom: 5%; | |
left: 3%; | |
font-size: 1.6rem; | |
} | |
@media (min-width: 40rem) and (min-height: 40rem) { | |
#product-overview { | |
height: 40vh; | |
background-position: 50% 25%; | |
} | |
#product-overview h1 { | |
font-size: 3rem; | |
} | |
} | |
.section-title { | |
color: #2ddf5c; | |
text-align: center; | |
} | |
.plan { | |
background: #d5ffdc; | |
text-align: center; | |
padding: 1rem; | |
margin: 0.5rem 0; | |
width: 100%; | |
} | |
.plan--highlighted { | |
background: #19b84c; | |
color: white; | |
} | |
.plan__annotation { | |
background: white; | |
color: #19b84c; | |
padding: 0.5rem; | |
box-shadow: 2px 2px 2px 2px rgba(0, 0, 0, 0.5); | |
border-radius: 8px; | |
} | |
.plan__title { | |
color: #0e4f1f; | |
} | |
.plan__price { | |
color: #858585; | |
} | |
.plan--highlighted .plan__title { | |
color: white; | |
} | |
.plan--highlighted .plan__price { | |
color: #0e4f1f; | |
} | |
.plan__features { | |
list-style: none; | |
margin: 0; | |
padding: 0; | |
} | |
.plan__feature { | |
margin: 0.5rem 0; | |
} | |
@media (min-width: 40rem) { | |
/*assignment => flex container*/ | |
.plan__list { | |
width: 100%; | |
display: flex; | |
justify-content: center; | |
align-items: center; | |
} | |
/*assignment => flex container*/ | |
.plan { | |
width: 30%; | |
min-width: 13rem; | |
max-width: 25rem; | |
display: flex; | |
flex-direction: column; | |
justify-content: center; | |
align-items: center; | |
} | |
/*assignment => z-index & height*/ | |
.plan--highlighted { | |
z-index: 1; | |
box-shadow: 2px 2px 2px 2px rgba(0, 0, 0, 0.5); | |
} | |
} | |
#key-features { | |
background: #ff1b68; | |
margin-top: 5rem; | |
padding: 1rem; | |
} | |
#key-features .section-title { | |
color: white; | |
margin: 2rem; | |
} | |
.key-feature__list { | |
list-style: none; | |
margin: 0; | |
padding: 0; | |
text-align: center; | |
} | |
.key-feature__image { | |
background: #ffcede; | |
width: 128px; | |
height: 128px; | |
border: 2px solid #424242; | |
border-radius: 50%; | |
margin: auto; | |
padding: 1.5rem; | |
} | |
.key-feature__description { | |
text-align: center; | |
font-weight: bold; | |
color: white; | |
font-size: 1.2rem; | |
} | |
@media (min-width: 40rem) { | |
/*assignment*/ | |
.key-feature { | |
width: 30%; | |
max-width: 25rem; | |
} | |
/*assignment => add .key-feature_list => flex container*/ | |
.key-feature__list { | |
display: flex; | |
flex-direction: row; | |
justify-content: center; | |
align-items: flex-start; | |
} | |
} | |
/* h1 { | |
font-family: sans-serif; | |
} */ | |
.modal { | |
position: fixed; | |
display: none; | |
z-index: 200; | |
top: 20%; | |
left: 30%; | |
width: 40%; | |
background: white; | |
padding: 1rem; | |
border: 1px solid #ccc; | |
box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5); | |
} | |
.modal__title { | |
text-align: center; | |
margin: 0 0 1rem 0; | |
} | |
.modal__actions { | |
text-align: center; | |
} | |
.modal__action { | |
border: 1px solid #0e4f1f; | |
background: #0e4f1f; | |
text-decoration: none; | |
color: white; | |
font: inherit; | |
padding: 0.5rem 1rem; | |
cursor: pointer; | |
} | |
.modal__action:hover, | |
.modal__action:active { | |
background: #2ddf5c; | |
border-color: #2ddf5c; | |
} | |
.modal__action--negative { | |
background: red; | |
border-color: red; | |
} | |
.modal__action--negative:hover, | |
.modal__action--negative:active { | |
background: #ff5454; | |
border-color: #ff5454; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment