guys if you can give me some suggestion on when i try to zoom the browser the right side product detail box going down , how can i solve that? and on the mobile devise it;s not good
Paweł Chudecki
@SoulRvr29All comments
- @kalWick01What are you most proud of, and what would you do differently next time?@SoulRvr29
You have set
width: 40%
in the.container
class, so the card can only occupy 40% of the width and when the screen is reduced, it does not fit, so the right side slides down. Removewidth: 40%
and instead set e.g.max-width: 600px
.In the body you have set
height: 100vh
, never set a fixed page height, because if something is too big it will be cut off, instead setmin-height: 100vh
.Marked as helpful - @jeremy-prt@SoulRvr29
When you set
position: absolute;
on your button, you should set it's parent toposition: relative
.Set
.action
toposition: relative
, and then in the button instead ofleft: 500px;
setright: 0;
. Also removeleft: 265px;
from media queries. This should help. Good luck!Marked as helpful - @ughvop@SoulRvr29
To make the hover effect, first add the icon
icon-view.svg
to the HTML in the section with the hero class. Then replace in your CSS.hero img { border-radius: 10px; }
with:
.hero { background-color: var(--cyan); border-radius: 10px; overflow: hidden; position: relative; } .hero:hover img:first-child { opacity: 0.5; cursor: pointer; } .hero:hover img:last-child { display: block; cursor: pointer; } .hero img:first-child { display: block; width: 100%; } .hero img:last-child { position: absolute; display: none; top: calc(50% - 1.5rem); left: calc(50% - 1.5rem); width: 3rem; height: 3rem; }
The background behind the image will be cyan and when hover occurs the image will become semi-transparent. You can rename
img:first-child
andimg:last-child
to your own class names for better readability.Marked as helpful - @Sevich-Kah@SoulRvr29
I think you pasted a wrong link in the HTML, in the head section. Try replacing your
<link href="https...
with:<link href="https://fonts.googleapis.com/css2?family=Overpass:wght@400;700&display=swap" rel="stylesheet ">
and it sould work. Good luck.
Marked as helpful - @Zethess@SoulRvr29
Looks good, I like the animation. I would correct a few things: during the hover, the numbers should be white, because the gray color on the orange background is difficult to see. The submit text could be more centered, I would add
padding-top: 4px;
to it. And finally, in my opinion, the submit button should be inactive if nothing is selected. Good luck.Marked as helpful - @SoulRvr29@SoulRvr29
I don't know why the background image (stripes) is not displayed. If anyone knows how to fix this, please let me know.
- @RIDOULL@SoulRvr29
To center the page, remove the
margin-top: 100px;
andwidth: 1440px
from the body, add the following instead:display: flex; justify-content: center; align-items: center;
also remove
position: absolute;
from your.bottom-container
, and from.top-container
. Do not set fixed page dimensions, but for egmax-width: 1000px;
. Happy coding! - @KeoLamola@SoulRvr29
You can center your
.container
in a better way. Add tobody
:body{ min-height: 100vh; display: grid; place-content: center; }
or if you want to use flexbox:
body { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; }
Then you can remove in
.container
margin: 95px 400px
andposition: fixed
. Also remove the properties in.attribute
, you don't need them.Avoid setting elements to a fixed height. The width is better to be set with
max-width
. Good luck, and happy coding!Marked as helpful - @Nojann@SoulRvr29
To center the component, add
min-height: 100vh
tobody
, the site will take full height. Then move all properties from.card
tobody
. Happy coding. - @ArtsCode101@SoulRvr29
It looks like your
.attribution
is overlapping the.container
. It's better to center the page in thebody
section. Try to add to yourbody
;min-height: 100vh; display: grid; place-content: center;
Then you can delete in
.container
:position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
This should help. Happy coding.
- @No0nesgonnaknow@SoulRvr29
On a wider screen the product module is too wide, try to add
max-width: 650px
to#sell-item
,and maybe also remove themargin: 10%
; from#sell-item
and add to the body:display: grid; place-content: center; min-height: 100vh;
- P@Ginver@SoulRvr29
To better position this popup, add a
.popup
class to your css and set it toposition:relative;
. Then changeposition: fixed;
in your.popup--social
class toposition: absolute;
. Now it will stick with your card. Then you can changebottom
, andright
in.popup--social
for something likebottom: 60px;
andright: -120px
.Marked as helpful - @Elryon@SoulRvr29
Add this to body in css to center the page:
display: grid; place-content: center;
If you want to learn more about the grid, check out this guide: click
- @mister1mohit@SoulRvr29
Try to delete
width: 45%;
from.summary
, and then the right part will be centered.Marked as helpful - @marvo-gift@SoulRvr29
To place the attribution at the bottom of the site, add to body
flex-direction: column;
. In main, replacewidth: 20%;
with egmax-width: 320px;
, and in HTML replace h3 with h1, the page should always contain h1 header. - @qusaikader@SoulRvr29
Looks good. You could replace h3 with h1 in html, because the page should always contain h1, and maybe also container with main for better semantics.
- @mahdi123M3@SoulRvr29
You should move the attribution to the bottom of the page. To do this, add to the body:
body{ flex-direction: column; }
then replace your margin-right in .attribution with:
.attribution{ margin: 10px auto; }
Marked as helpful - @PrathamS1@SoulRvr29
You can center everything in an better way. Remove margin-top: 10%; from container and add:
body{ min-height: 100vh; display: grid; place-content: center; }
or if you want to use flexbox:
body { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; }
This guide helped me a lot in understanding grid: click here
Marked as helpful