Hand in Project 2 My Childhood Pets#29
Conversation
HIPPIEKICK
left a comment
There was a problem hiding this comment.
Nice work with the flexbox! I really enjoy the background gradient and that you used flex-wrap: wrap. A little tip for images:
- When you have set width and height on images they can get distorted. You can add
object-fit: cover;to the images to prevent that.
Keep up the good work :)
| @@ -0,0 +1,25 @@ | |||
| <!DOCTYPE html> | |||
| <section class="pets"> | ||
| <div class="flex-child jason">Jason <img class="pet-image" src="https://images.pexels.com/photos/544269/pexels-photo-544269.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1" alt="Jason" /></div> | ||
| <div class="flex-child paco">Paco <img src="https://images.pexels.com/photos/162149/dog-black-labrador-black-dog-162149.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1" alt ="Paco" /></div> | ||
| <div class="flex-child garfield">Garfield <img src="https://images.pexels.com/photos/6982643/pexels-photo-6982643.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1" alt="Garfield" /></div> | ||
| <div class="flex-child tiger">Tiger <img src="https://images.pexels.com/photos/617278/pexels-photo-617278.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1" alt="Tiger" /></div> | ||
| <div class="flex-child max">Max <img src="https://images.pexels.com/photos/104373/pexels-photo-104373.jpeg?cs=srgb&dl=pexels-mike-b-104373.jpg&fm=jpg&_gl=1*g3sdv7*_ga*NjE4MzQxMDQ4LjE2NjY0MjMyNDY.*_ga_8JE65Q40S6*MTY2NjQyMzI0Ni4xLjEuMTY2NjQyNDczOC4wLjAuMA.." alt="Max" /> </div> | ||
| <div class="flex-child moritz">Moritz <img src="https://images.pexels.com/photos/372166/pexels-photo-372166.jpeg?cs=srgb&dl=pexels-pixabay-372166.jpg&fm=jpg&_gl=1*14yy15f*_ga*NjE4MzQxMDQ4LjE2NjY0MjMyNDY.*_ga_8JE65Q40S6*MTY2NjQyMzI0Ni4xLjEuMTY2NjQyMzMxOS4wLjAuMA.." alt="Moritz" /> </div></section> |
There was a problem hiding this comment.
This looks a bit messy. Remember to always use correct indentation so that the opening tag and the closing tags end up at the same indentation level. Also - always indent children. Compare this snippet with indentation, it gets much easier to read and nice to look at, right? 😇
<section class="pets">
<div class="flex-child jason">
<p>Jason</p> <!--I added a paragraph tag here-->
<img
class="pet-image"
src="https://images.pexels.com/photos/544269/pexels-photo-544269.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1"
alt="Jason" />
</div>
<div class="flex-child paco">
Paco
<img
src="https://images.pexels.com/photos/162149/dog-black-labrador-black-dog-162149.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1"
alt ="Paco" />
</div>
<div class="flex-child garfield">
Garfield
<img
src="https://images.pexels.com/photos/6982643/pexels-photo-6982643.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1"
alt="Garfield" />
</div>
</section>
| <div class="hamburger"> | ||
| <div></div> | ||
| <div></div> | ||
| <div></div> | ||
| </div> |
| <div></div> | ||
| <div></div> | ||
| </div> | ||
| </header> |
There was a problem hiding this comment.
If this is the closing tag, where is the opening tag? 🤔
| body { | ||
| background: radial-gradient( | ||
| circle at 7.5% 24%, | ||
| rgb(237, 161, 193) 0%, | ||
| rgb(250, 178, 172) 25.5%, | ||
| rgb(190, 228, 210) 62.3%, | ||
| rgb(215, 248, 247) 93.8% | ||
| ); | ||
| font-family: "Gill Sans", "Gill Sans MT", Calibri, "Trebuchet MS", sans-serif; | ||
| font-size: 20px; | ||
| } |
There was a problem hiding this comment.
Looking good! If you add min-height: 100vh; you will get rid of the line
| .pets { | ||
| display: flex; | ||
| align-items: center; | ||
| justify-content: center; | ||
| flex-direction: row; | ||
| flex-wrap: wrap; | ||
|
|
||
| } |
| .flex-child { | ||
| margin: 5px; | ||
| width: 200px; | ||
| border: solid black; | ||
| gap: 5px; | ||
| } | ||
| .jason { | ||
| background-color: burlywood; | ||
| } | ||
| .paco { | ||
| background-color: aquamarine; | ||
| } | ||
| .garfield { | ||
| background-color: blueviolet; | ||
| } | ||
| .tiger { | ||
| background-color: blue; | ||
| } | ||
| .max { | ||
| background-color: darkorange; | ||
| } | ||
| .moritz { | ||
| background-color: palevioletred; | ||
| } |
There was a problem hiding this comment.
Really great way of keeping it DRY! 👍
No description provided.