-
-
Notifications
You must be signed in to change notification settings - Fork 609
LONDON CLASS _8-DONA_SHEHU-HTML/CSS-WEEK_3 #276
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 |
---|---|---|
|
@@ -6,11 +6,73 @@ | |
<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 --> | ||
<link rel="stylesheet" href="style.css"> | ||
</head> | ||
<body class="body"> | ||
|
||
<body> | ||
<!-- Add your markup here --> | ||
</body> | ||
|
||
</html> | ||
<!--HEADER--> | ||
<header class="header"> | ||
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. Well done on separating the sections into header, main, and footer using proper semantic HTML. I would do exactly the same! |
||
<!--LOGO & HAMBURGER MENU--> | ||
<div class="homepage-header"> | ||
<div class="logo-img"> <img class="logo-img" src ="images/arno-senoner-MRjjcDIk3Gw-unsplash.jpg" alt ="logo-img"/></div> | ||
<div class="hamburger-logo"><img class="hamburger-logo" src="images/threelines.png" alt="hamburger-menu"/> </div> | ||
</div> | ||
<div class="header-p"> | ||
<p>The best cakes in town delivered to your door!</p> | ||
</div> | ||
</header> | ||
<!---------MAIN---------> | ||
<main class= "main"> | ||
<nav class="nav-bar"> | ||
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. In my opinion, nav tag should be part of the header, not the main content. Main tag should only contain the contents of the web page |
||
<ul> | ||
<li> <a href ="#">HOME</a> </li> | ||
<li> <a href ="#">CAKES</a> </li> | ||
<li> <a href ="#">ORDERING</a> </li> | ||
<li> <a href ="#">LESSONS</a> </li> | ||
<li> <a href ="#">ABOUT</a> </li> | ||
</ul> | ||
</nav> | ||
<!------ WELCOME & PARAGRAPH SECTION---------> | ||
<section class="change-position"> | ||
<div class="homepage-welcome"> | ||
<h1>Welcome</h1> | ||
<p>Celebrate your special day with our range of personalized cakes,handcrafted, | ||
fresh and delivered in the same day across London.</p> | ||
</div> | ||
<!----------HERO SECTION---------> | ||
<div class="homepage-hero"> | ||
<img src="images/american-heritage-chocolate-vdx5hPQhXFk-unsplash.jpg" alt ="hero-img" /> | ||
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. Hi Dona, try to use alt attribute to describe your image |
||
</div> | ||
</section> | ||
<!-------PRODUCTS SECTION---------> | ||
<section class="homepage-products"> | ||
<div class="products"> | ||
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. Looks sleek and well-structured! |
||
<img src="images/mike-meeks-zk-fclJdGas-unsplash.jpg" alt ="cupcakes"/> | ||
<figcaption> Cupcakes</figcaption> | ||
</div> | ||
<div class="products"> | ||
<img src="images/annie-spratt-EACvtuV2k2E-unsplash.jpg" alt ="doughnuts"/> | ||
<figcaption> Doughnuts</figcaption> | ||
</div> | ||
<div class="products"> | ||
<img src="images/anthony-espinosa-6iqpLKqeaE0-unsplash.jpg" alt="tiramisu"> | ||
<figcaption> Tiramisu</figcaption> | ||
</div> | ||
<div class="products"> | ||
<img src="images/toa-heftiba-U_zIfKfEoRM-unsplash.jpg" alt ="modern"/> | ||
<figcaption> Modern Cakes</figcaption> | ||
</div> | ||
</section> | ||
</main> | ||
<footer class="footer"> | ||
<section class="homepage-footer "> | ||
<div class="footer"> <a href ="#">About Us</a></div> | ||
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. You have one class name "footer" for many divs, wrap them in one to avoid repeating it |
||
<div class="footer"><a href ="#">Contact Us</a></div> | ||
<div class="footer"><a href="#">Our Policy</a></div> | ||
</section> | ||
<section class="copy-right"> | ||
<p>© BonTon Cakes</p> | ||
</section> | ||
</footer> | ||
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. Great use of semantic tags overall |
||
</body> | ||
</html> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,204 @@ | ||
/* Add your styling here */ | ||
|
||
.body{ | ||
display:grid; | ||
grid-template-columns: repeat(4, 1fr); | ||
grid-template-rows: auto; | ||
grid-template-areas: | ||
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. well done! |
||
"header header header header" | ||
"main main main main" | ||
"footer footer footer footer"; | ||
} | ||
|
||
/***HEADER***/ | ||
.header { | ||
grid-area: header; | ||
background-color:rgb(245, 233, 245) ; | ||
} | ||
.homepage-header { | ||
display: flex; | ||
justify-content: space-between; | ||
padding:15px; | ||
} | ||
.logo-img { | ||
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. Using % for width shows how great your understanding of CSS is |
||
height: 50%; | ||
border-radius:80%; | ||
object-fit: cover; | ||
|
||
} | ||
.hamburger-logo { | ||
width: 60px; | ||
height: 40px; | ||
} | ||
.header-p { | ||
font-family:system-ui; | ||
color:rebeccapurple; | ||
font-size: 20px; | ||
margin: 50px 20px 0 0 ; | ||
text-align: right; | ||
} | ||
.nav-bar { | ||
display: none;; | ||
} | ||
/***MAIN**/ | ||
.main { | ||
grid-area: main; | ||
} | ||
|
||
/****WELCOME & PARAGRAPH***/ | ||
.homepage-welcome { | ||
margin-bottom: 50px; | ||
} | ||
.homepage-welcome h1 { | ||
font-size: 50px; | ||
color:rebeccapurple; | ||
text-shadow: 0 0 3px #FF0000, 0 0 5px #0000FF; | ||
} | ||
.homepage-welcome p { | ||
font-size:30px; | ||
} | ||
|
||
/***HERO***/ | ||
.homepage-hero img { | ||
width:100%; | ||
} | ||
.homepage-hero { | ||
margin-bottom: 50px; | ||
} | ||
|
||
/***PRODUCTS***/ | ||
.homepage-products { | ||
display: grid; | ||
grid-template-columns:repeat(2,1fr); | ||
grid-template-rows: 200px 200px; | ||
grid-gap:30px; | ||
padding: 0 20px; | ||
margin-bottom: 100px; | ||
} | ||
.products,figcaption { | ||
text-align: center; | ||
font-size:15px; | ||
font-weight: bold; | ||
color:black | ||
} | ||
.products img { | ||
width: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. yes thats correct! having 100% width and height applied to the image(s), those images will then try to fit whatever width of the div that wrap them. I would do exactly the same to achieve responsiveness |
||
height:100%; | ||
object-fit: cover; | ||
border-radius: 35px; | ||
border: 3px solid rgb(226, 213, 213); | ||
} | ||
/***FOOTER***/ | ||
.footer { | ||
grid-area: footer; | ||
} | ||
.homepage-footer { | ||
font-size: 25px; | ||
display: flex; | ||
flex-direction: column; | ||
margin-bottom: 50px; | ||
} | ||
.homepage-footer a { | ||
text-decoration: none; | ||
margin-bottom: 10px; | ||
|
||
} | ||
.copy-right { | ||
text-align: center; | ||
} | ||
/* TABLET VERSION*/ | ||
@media screen and (min-width: 550px) { | ||
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. Was this break point not supposed to start at 540px? 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. I believe the homework mentions only 2 breakpoints: 540px and 900px! |
||
.homepage-header { | ||
margin-top: 50px 0; | ||
display: flex; | ||
justify-content: space-between; | ||
|
||
} | ||
.header-p { | ||
font-size: 30px; | ||
text-align: center; | ||
padding-bottom: 40px; | ||
} | ||
.hamburger-logo { | ||
width: 80px; | ||
height: 60px; | ||
text-align: right; | ||
} | ||
.homepage-welcome p { | ||
font-size:30px; | ||
} | ||
.homepage-header .logo-img { | ||
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. Great way of avoiding code repetition |
||
width: 50%; | ||
height: 50%; | ||
border-radius:70%; | ||
object-fit: cover; | ||
} | ||
|
||
.homepage-products { | ||
display: grid; | ||
grid-template-columns:repeat(2,1fr); | ||
grid-template-rows: 250px 250px; | ||
grid-gap:30px; | ||
padding: 0 20px; | ||
margin-bottom: 100px; | ||
} | ||
} | ||
|
||
@media screen and (min-width:900px) { | ||
.homepage-products { | ||
display: grid; | ||
grid-template-columns:repeat(4,1fr); | ||
grid-template-rows:auto | ||
} | ||
|
||
.homepage-welcome { | ||
width:50%; | ||
text-align: left; | ||
padding:0 30px; | ||
} | ||
.homepage-hero { | ||
width:50%; | ||
} | ||
.homepage-products { | ||
display: flex; | ||
justify-content: space-evenly; | ||
} | ||
.change-position { | ||
padding: 0 30px; | ||
display: flex; | ||
flex-direction: row-reverse; | ||
justify-content: center; | ||
} | ||
.hamburger-logo img { | ||
display:none; | ||
} | ||
.nav-bar { | ||
display:block; | ||
font-size: 22px; | ||
margin-bottom: 50px; | ||
padding-right: 30px; | ||
} | ||
.nav-bar ul { | ||
display: flex; | ||
list-style: none; | ||
text-decoration: none; | ||
justify-content: flex-end; | ||
} | ||
.nav-bar a { | ||
text-decoration: none; | ||
padding: 15px; | ||
} | ||
.products { | ||
width: 250px; | ||
height: 250px; | ||
object-fit: cover; | ||
} | ||
.homepage-footer { | ||
display: flex; | ||
} | ||
.homepage-footer { | ||
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. footer should be aligned in one row instead of 3 rows for desktop view |
||
display: flex; | ||
flex-direction: row; | ||
justify-content: space-evenly; | ||
} | ||
} |
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.
Please make sure the indentation in this document is properly done please :)