Skip to content

Section 4 #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Sep 1, 2022
53 changes: 53 additions & 0 deletions starter/04-CSS-Layouts/challenge/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<!DOCTYPE html>
<html lang="en">
<header>
<title>Converse</title>
<meta charset="UTF-8">
<link rel="stylesheet" href="style.css">
</header>

<body>
<article class="product">
<h2 class="product-title">Converse Chuck Taylor All Star Low Top</h2>
<img
src="https://i.ibb.co/Jr7Wh1d/challenges.jpg"
alt="Chuck Taylor All Star Shoe"
height="250"
width="250"
class="product-img"
/>
<div class="product-info">
<div class="product-info-header">
<p class="price"><strong>$65.00</strong></p>
<p class="shipping">Free shipping</p>
</div>
<p class="sale">Sale</p>

<p class="product-description">
Ready to dress up or down, these classic canvas Chucks are an everyday
wardrobe staple.
</p>
<a href="https://converse.com" target="_blank" class="more-info">More information &rarr;</a>

<div class="colors">
<div class="color"></div>
<div class="color color-blue"></div>
<div class="color color-red"></div>
<div class="color color-yellow"></div>
<div class="color color-green"></div>
<div class="color color-brown"></div>
</div>
</div>

<div class="product-details">
<h3 class="details-title">Product details</h3>
<ul class="details-list">
<li>Lightweight, durable canvas sneaker</li>
<li>Lightly padded footbed for added comfort</li>
<li>Iconic Chuck Taylor ankle patch.</li>
</ul>
</div>
<button class="add-cart">Add to cart</button>
</article>
</body>
</html>
170 changes: 170 additions & 0 deletions starter/04-CSS-Layouts/challenge/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}

body {
font-family: sans-serif;
line-height: 1.4;
}

/* .container {
align-items: center;
display: flex;
gap: 40px;
} */

.product-img { }

/* PRODUCT */
.product {
border: 4px solid black;
width: 825px;
margin: 50px auto;
position: relative;
}

.product-title {
text-align: center;
font-size: 22px;
text-transform: uppercase;
background-color: #f7f7f7;
padding: 15px;
}

/* PRODUCT INFORMATION */
.product-info {
/* (825 - 8 - 250 - 80) / 2 */
flex: 1;
}

.product-info-header {
align-items: center;
display: flex;
justify-content: space-between;
}

.price {
font-size: 24px;
}

.shipping {
font-size: 12px;
text-transform: uppercase;
font-weight: bold;
color: #777;
}

.sale {
background-color: #ec2f2f;
color: #fff;
font-size: 12px;
text-transform: uppercase;
font-weight: bold;
letter-spacing: 2px;
padding: 7px 15px;
display: inline-block;
position: absolute;
top: -17px;
left: -38px;

/* width: 40px;
text-align: center; */
}

.product-description {
margin-bottom: 10px;
}

.more-info:link, .more-info:visited {
color: black;
margin-bottom: 30px;
display: inline-block;
}

.more-info:hover, .more-info:active {
text-decoration: none;
}

.colors {
align-items: center;
display: flex;
gap: 10px;
justify-content: flex-start;
}

.color {
background-color: #000;
height: 22px;
width: 22px;
}

.color-blue {
background-color: #2f6ee2;
}
.color-red {
background-color: #ec2f2f;
}
.color-yellow {
background-color: #f0bf1e;
}
.color-green {
background-color: #90cc20;
}
.color-brown {
background-color: #885214;
}

/* PRODUCT DETAILS */
.product-details {
flex: 1;
}

.details-title {
text-transform: uppercase;
font-size: 16px;
margin-bottom: 15px;
}

.details-list {
list-style: square;
margin-left: 20px;
}

.details-list li {
margin-bottom: 10px;
}

/* BUTTON */
.add-cart {
background-color: #000;
border: none;
color: #fff;
font-size: 20px;
text-transform: uppercase;
cursor: pointer;
padding: 15px;
width: 100%;
border-top: 4px solid black;
}

.add-cart:hover {
color: #000;
background-color: #fff;
}

.product {
display: grid;
grid-template-columns: 250px 1fr 1fr;
column-gap: 40px;
align-items: center;
}

.product-title {
grid-column: 1 / -1;
}

.add-cart {
grid-column: 1 / -1;
}
41 changes: 37 additions & 4 deletions starter/04-CSS-Layouts/css-grid.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,14 @@
}
.el--2 {
background-color: orangered;
/* grid-column: 1 / 2; */
/* grid-column: 1 / -1; */
grid-column: 1 / span 1;
grid-row: 2 / 3;
}
.el--3 {
background-color: green;
height: 150px;
/* height: 150px; */
}
.el--4 {
background-color: goldenrod;
Expand All @@ -24,35 +28,64 @@
}
.el--6 {
background-color: steelblue;
grid-column: 4 / span 1;
grid-row: 1 / span 2;
}
.el--7 {
background-color: yellow;
}
.el--8 {
background-color: crimson;
grid-column: 2 / 3;
grid-row: 1 / 2;
}

.container--1 {
/* STARTER */
font-family: sans-serif;
background-color: #ddd;
font-size: 40px;
font-size: 32px;
margin: 40px;
height: 500px;

/* CSS GRID */
display: grid;
/* gap: 30px; */
column-gap: 10px;
row-gap: 40px;
/* grid-template-columns: 2fr 1fr 1fr auto; */
grid-template-columns: repeat(4, 1fr);
/* grid-template-rows: 300px 200px; */
grid-template-rows: 1fr 1fr;
}

.container--2 {
/* STARTER */
font-family: sans-serif;
background-color: black;
font-size: 40px;
margin: 100px;
margin: 40px;

width: 1000px;
width: 700px;
height: 600px;

/* CSS GRID */
display: grid;
grid-template-columns: 125px 200px 125px;
grid-template-rows: 250px 100px;
gap: 10px;

/* Align tracks in container. Distribute empty space. */
justify-content: center;
align-content: center;

/* Align items inside cells. */
align-items: center;
justify-items: center;
}

.el--3 {
align-self: end;
}
</style>
</head>
Expand Down
34 changes: 33 additions & 1 deletion starter/04-CSS-Layouts/flexbox.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,42 @@
/* STARTER */
font-family: sans-serif;
background-color: #ddd;
font-size: 40px;
font-size: 32px;
margin: 40px;

/* FLEXBOX */
align-items: center;
display: flex;
gap: 10px;
justify-content: flex-start;
}

.el {

/* DEFAULTS:
flex-grow: 0;
flex-shrink: 1;
flex-basis: auto; */

/* flex-basis: 200px; */
/* flex-shrink: 0; */
/* flex-grow: 1; */
flex: 1;
}

.el--1 {
align-self: flex-start;
/* order: 2; */
/* flex-grow: 3; */
}

.el--5 {
align-self: stretch;
order: 1;
}

.el--6 {
order: -1;
}
</style>
</head>
Expand Down
Loading