-
-
Notifications
You must be signed in to change notification settings - Fork 596
Class9-Leila-Farsani-HTML-CSS-Coursework-Week3 #447
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,16 +1,126 @@ | ||
| <!DOCTYPE html> | ||
| <html lang="en"> | ||
|
|
||
| <head> | ||
| <meta charset="UTF-8"> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
| <meta http-equiv="X-UA-Compatible" content="ie=edge"> | ||
| <head> | ||
| <meta charset="UTF-8" /> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
| <meta http-equiv="X-UA-Compatible" content="ie=edge" /> | ||
| <title>Responsive Cake webpage</title> | ||
| <!-- Add a link to your css file here --> | ||
| </head> | ||
| <link rel="stylesheet" href="style.css" /> | ||
| </head> | ||
|
|
||
| <body> | ||
| <body> | ||
| <!-- Add your markup here --> | ||
| </body> | ||
|
|
||
| </html> | ||
| <header> | ||
| <div class="header-content"> | ||
| <div class="logo-img"> | ||
| <img | ||
| src="https://www.pngitem.com/pimgs/m/535-5356719_vegan-bakery-logo-designs-hd-png-download.png" | ||
| alt="Cake logo" | ||
| /> | ||
| </div> | ||
| <div class="hamburger"> | ||
| <div class="hamburger"> | ||
| <span class="bar"></span> | ||
| <span class="bar"></span> | ||
| <span class="bar"></span> | ||
| </div> | ||
| </div> | ||
| <div class="header-text"> | ||
| <span>The best cakes in town delivered to your door</span> | ||
| </div> | ||
| </div> | ||
| </header> | ||
| <main> | ||
| <nav class="nav"> | ||
| <ul class="menu"> | ||
| <li class="items"> | ||
| <a href="/index.html" class="links">Home</a> | ||
| </li> | ||
| <li class="items"> | ||
| <a href="#" class="links">Cakes</a> | ||
| </li> | ||
| <li class="items"> | ||
| <a href="#" class="links">Orderin</a> | ||
| </li> | ||
| <li class="items"> | ||
| <a href="#" class="links">Lessons</a> | ||
| </li> | ||
| <li class="items"> | ||
| <a href="#" class="links">About</a> | ||
| </li> | ||
| </ul> | ||
| </nav> | ||
| <section class="hero"> | ||
| <h1>Welcome</h1> | ||
| <div class="main-text"> | ||
| <p> | ||
| We are very experienced in making and decorating our vegan cakes. | ||
| All of our cakes are vegan, so they are all 100% free-from dairy and | ||
| eggs. We use a range of plant-based ingredients in our mixes and | ||
| icings. Also all of our cakes can be made gluten free if requested. | ||
| </p> | ||
| </div> | ||
| <figure class="fab-img"> | ||
| <img | ||
| class="main-img" | ||
| src="https://thebananadiaries.com/wp-content/uploads/2020/07/homemade-vegan-wedding-cake-recipe_5088-1333x2000.jpg" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This image is taller than it is wide (portrait), would be easier to match the design if you pick one that's wider than it is tall (landscape) |
||
| alt="Fab Image" | ||
| /> | ||
| </figure> | ||
| </section> | ||
| <section class="cakes"> | ||
| <div class="cake-item"> | ||
| <img | ||
| class="cake-img" | ||
| src="https://biancazapatka.com/wp-content/uploads/2019/06/best-vegan-chocolate-cake-recipe-cherry-frosting-ganache.jpg | ||
| " | ||
| alt="Chocolate Cake Image" | ||
| /> | ||
| </div> | ||
| <div class="cake-item"> | ||
| <img | ||
| class="cake-img" | ||
| src="https://biancazapatka.com/wp-content/uploads/2019/06/vegan-vanilla-cake-recipe-buttercream-frosting-torte-layer-naked-cake-foodstyling.jpg/img/prod2.jpg" | ||
| alt="Cherry Cake Image" | ||
| /> | ||
| </div> | ||
| <div class="cake-item"> | ||
| <img | ||
| class="cake-img" | ||
| src="https://jessicainthekitchen.com/wp-content/uploads/2020/12/Vegan-Vanilla-Cake-12.jpg" | ||
| alt="Vanila Cake Image" | ||
| /> | ||
| </div> | ||
| <div class="cake-item"> | ||
| <img | ||
| class="cake-img" | ||
| src="https://domesticgothess.com/wp-content/uploads/2018/07/vegan-banana-cake-with-chocolate-frosting.jpg" | ||
| alt="Banana Cake Image" | ||
| /> | ||
| </div> | ||
| </section> | ||
| </main> | ||
| <footer> | ||
| <h3>For more information join us on</h3> | ||
| <ul> | ||
| <li> | ||
| <a href="https://facebook.com"> | ||
| <img | ||
| src="https://th.bing.com/th/id/R.dabbf52a8b1dfa865bb752ff46a5d61f?rik=lfoTk1OXHhJL6g&riu=http%3a%2f%2f3.bp.blogspot.com%2f-bmjsXhRZMUM%2fTi1Zp2K8SNI%2fAAAAAAAAAgM%2fXibusKQPf7g%2fs1600%2ffacebook_logo.jpg&ehk=C6myYMpwdHQxvjjY34WChIzo7%2fAquhNfPiXK7kDJ0ww%3d&risl=&pid=ImgRaw&r=0" | ||
| alt="Facebook Logo" | ||
| /></a> | ||
| </li> | ||
| <li> | ||
| <a href="https://instagram.com" | ||
| ><img | ||
| src="https://th.bing.com/th/id/R.bd5047bd44f35ee3cda2f5131c3d03f1?rik=14jsLIcT1jIO4g&pid=ImgRaw&r=0" | ||
| alt="Instagram Logo" | ||
| /> | ||
| </a> | ||
| </li> | ||
| </ul> | ||
| <p>Leila Farsani</p> | ||
| </footer> | ||
| </body> | ||
| </html> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,134 @@ | ||
| /* Add your styling here */ | ||
| * { | ||
| margin: 0; | ||
| padding: 0; | ||
| } | ||
|
|
||
| .header-content { | ||
| display: grid; | ||
| grid-template-columns: 45% 55%; | ||
| background-color: rgb(12, 228, 113); | ||
| padding: 20px; | ||
| border-bottom: 1px solid #eee; | ||
| } | ||
| .logo-img { | ||
| grid-row: 1 / -1; | ||
| margin-left: 10px; | ||
| } | ||
| .logo-img img { | ||
| display: grid; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So that the image fills its grid cell and gets bigger / smaller as the viewport changes width, try removing |
||
| opacity: 100%; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| width: 250px; | ||
| height: 200px; | ||
| } | ||
| .items { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The nav isn't shown on small screens, so no need to style |
||
| margin: 3rem 0; | ||
| flex-shrink: inherit; | ||
| margin: 0; | ||
| } | ||
| .links { | ||
| text-transform: uppercase; | ||
| font-weight: 300; | ||
| background-color: #0d3b19; | ||
| padding: 5px 30px; | ||
| color: #eee; | ||
| } | ||
| .header-text { | ||
| grid-column: 2 / -1; | ||
| font-size: 30px; | ||
| font-weight: 300; | ||
| font-style: italic; | ||
| color: #0d3b19; | ||
| direction: rtl; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
| margin-top: -30px; | ||
| } | ||
|
|
||
| .hamburger { | ||
| justify-self: end; | ||
| padding: 10px 10px; | ||
| } | ||
| .bar { | ||
| display: block; | ||
| width: 40px; | ||
| height: 10px; | ||
| margin: 5px auto; | ||
| background-color: #0d2b14; | ||
| } | ||
| /* ----- Nav Menu ----- */ | ||
| .nav { | ||
| display: none; | ||
| } | ||
| .menu { | ||
| display: flex; | ||
| justify-content: flex-end; | ||
| flex-wrap: wrap; | ||
|
Comment on lines
+62
to
+63
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you remove these two lines, the items will run in a row, like in the design |
||
| align-items: center; | ||
| gap: 15px; | ||
| padding: 20px; | ||
| } | ||
|
|
||
| main h1 { | ||
| font-size: 40px; | ||
| font-weight: 400; | ||
| color: #1c5632; | ||
| } | ||
| main { | ||
| display: grid; | ||
| grid-template-columns: 20px 2fr 20px; | ||
| grid-column-gap: 20px; | ||
| } | ||
|
|
||
| .hero { | ||
| grid-column: 2; | ||
| min-width: 0; | ||
| display: grid; | ||
| gap: 30px; | ||
| padding: 20px 0; | ||
| } | ||
| .fab-img { | ||
| background-color: #f5f3f3; | ||
| } | ||
| .main-img { | ||
| object-fit: cover; | ||
| max-width: 50%; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The image should fill the width. Try replacing |
||
| max-width: 50%; | ||
| } | ||
|
|
||
| .cakes { | ||
| grid-column: 2; | ||
| display: grid; | ||
| grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if you try |
||
| padding: 20px 0; | ||
| gap: 20px; | ||
| } | ||
| .cake-img { | ||
| display: block; | ||
| max-width: 100%; | ||
| max-height: 100%; | ||
| } | ||
|
|
||
| footer { | ||
| display: flex; | ||
| flex-direction: column; | ||
| align-items: center; | ||
| justify-content: center; | ||
| margin: 0 6rem; | ||
| padding: 2rem 0; | ||
| gap: 1rem; | ||
| } | ||
|
|
||
| footer ul { | ||
| display: flex; | ||
| justify-content: center; | ||
| align-items: center; | ||
| list-style: none; | ||
| } | ||
| footer ul li { | ||
| display: block; | ||
| padding: 0.5rem; | ||
| margin: 10px; | ||
| } | ||
|
|
||
| footer ul li a img { | ||
| max-width: 4rem; | ||
| max-height: 4rem; | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The hamburger container is repeated twice