Skip to content
This repository was archived by the owner on Jan 14, 2024. It is now read-only.

LONDON CLASS _8-DONA_SHEHU-HTML/CSS-WEEK_3 #276

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/annie-spratt-EACvtuV2k2E-unsplash.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/anthony-espinosa-6iqpLKqeaE0-unsplash.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/arno-senoner-MRjjcDIk3Gw-unsplash.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/deva-williamson-rHz-DkDgA1k-unsplash.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/henry-be-_y5CCcYWTjU-unsplash.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/mike-meeks-zk-fclJdGas-unsplash.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/threelines.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/toa-heftiba-U_zIfKfEoRM-unsplash.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
74 changes: 68 additions & 6 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Copy link

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 :)


<body>
<!-- Add your markup here -->
</body>

</html>
<!--HEADER-->
<header class="header">
Copy link

Choose a reason for hiding this comment

The 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">
Copy link

Choose a reason for hiding this comment

The 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" />

Choose a reason for hiding this comment

The 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">
Copy link

Choose a reason for hiding this comment

The 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>

Choose a reason for hiding this comment

The 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>&#169; BonTon Cakes</p>
</section>
</footer>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great use of semantic tags overall

</body>
</html>
205 changes: 204 additions & 1 deletion style.css
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:
Copy link

Choose a reason for hiding this comment

The 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%;

Choose a reason for hiding this comment

The 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%;
Copy link

Choose a reason for hiding this comment

The 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) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this break point not supposed to start at 540px?

Copy link

Choose a reason for hiding this comment

The 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 {

Choose a reason for hiding this comment

The 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 {
Copy link

Choose a reason for hiding this comment

The 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;
}
}