Hello everyone,
- Having difficulties keeping the content and the image size the same in flexbox.
any feedback would be greatly appreciated.
Hello everyone,
any feedback would be greatly appreciated.
Hey @Soto-J
I saw your submission and found some issues. I am giving you some suggestions which will help you in improving your design.
Instead of giving the class card-container
to the body give this class to the div
inside body.
Then you can give the following styles to this class -
.card-container {
width: 100%;
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
}
This will make sure that all your content is in the center of the screen.
Then you can give property flex:1
to both of your sections inside the main. This will make sure that both of your sections have equal width.
To make the overlay effect you can do the following.
<div class="overlay"></div>
in your picture section..picture {
position: relative;
}
Then you can give the following styles to overlay
.overlay {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: hsl(277, 64%, 61%);
mix-blend-mode: multiply;
}
You can also try different values of mix-blend-mode.
I hope this will help you in improving your design.
any feedback welcome
Hey @joaojgabriel
Your background does not match the provided design. There are two approaches to doing this.
background-size, background-repeat, etc.
to make your background look like a design.position: relative;
to the parent element and can have two img
with the source of images and you can position them accordingly..parent {
position: relative;
}
.img-top {
position: absolute;
width: 100%;
top: -50%; /* this can be different according to you.*/
left: -50%; /* this can be different according to you.*/
}
.img-bottom {
position: absolute;
width: 100%;
bottom: -50%; /* this can be different according to you.*/
right: -50%; /* this can be different according to you.*/
}
Hope this will help you in improving your design.
Any feedback is welcome!
Hey @Soto-J I have some suggestions for you.
background-repeat: no-repeat;
which will make sure that your background image does not repeat.background-size: contain;
which will maintain the aspect ratio of the image, you can also use background-size: cover;
according to your need.hsl(245, 75%, 52%)
;Only these changes will make your design a lot better.
alt
text in your image.Hope this helps you.
Hey Guys, I just completed the product preview card project. I'm a newbie and my code is filled with errors and bad practices. I'll love criticisms and reviews on the code and how I can improve in the future. My questions for this challenge are:
Hey @IAmKachi
Media queries are difficult at first but when you get to know about they become a lot easier. You can refer to this link to learn about media queries -> Media Queries
Firstly learn about these two media queries and more than half of the work will be done -
@media only screen and (min-width: 900px) {} @media only screen and (max-width: 900px) {}
Should I give a class name to all my elements? I struggled a lot with making the content not go beyond the div, is there a way to make it say within the div at all times?
Hey @Isaaclkm, It is good to have classes on all of your HTML elements, but there are some CSS Selectors which are very helpful while working and styling using CSS. To learn about different CSS Selectors you can go with the following link. CSS Selectors
Apart from it, some issues which I found are:-
main, section, footer, etc
in your HTML./
in image src not \
E.g.
Use this<img src=`images/perf1.jpg` alt=`perfume bottle`>
not this
<img src=`images\perf1.jpg` alt=`perfume bottle`>
Please I would love any feedback
Hey, @Mosestule2003 Congratulations on your submission.
I looked at your design and found that it could be improved more. The things which you can improve are --
font-size
of paragraph to be 18px and don't have any <br> in your <p>. It will automatically fit with the container width.<main>
and you should also have <footer>
. So your report will not be having any issues.<!DOCTYPE html>
at the top of your HTML document.width: 100%
in the CSS not at the direct element.<p>
inside H3 or any other heading element, instead you can use <span>
.I hope this feedback will help you a little bit in improving your design. All the best.
Hello Nino, I think your live site url is not working fine. It is giving a 404 page not found error. You should update this.
Any feedback to help make my CSS more efficient would be awesome!
Hey @superschooler,
You can use
body { display: flex; align-items: center; justify-content: center; }
This will immediately make your solution more accurate to the design.