@MelvinAguilar
Posted
Hello there ๐. Good job on completing the challenge !
I have some suggestions about your code that might interest you.
HTML ๐ท๏ธ:
- The <br> tag is often used to create line breaks, but it doesn't convey any semantic meaning. When a screen-reader reads the text, it will break the flow of reading at the line break tag, which can be confusing for users.
CSS ๐จ:
- The
width: 100vw
property in themain
tag is not necessary. This will create a horizontal scrollbar on some devices.
- Use
min-height: 100vh
instead ofheight
. Setting the height to 100vh may result in the component being cut off on smaller screens, such as a mobile phone in landscape orientation.
- Do not use
overflow: hidden
on the body element, this will prevent scrolling on some devices. โ ๏ธ
-
In this challenge, a media query is not necessary. If you want to create a responsive component, use
max-width
instead ofwidth
, add somemargin
and remove its height. Let the content determine the height of the component..kartu { /* position: relative; */ /* height: 600px; */ /* width: 400px; */ max-width: 400px; margin: 1rem; } @media screen and (max-width: 720px) { .kartu { /* width: 90%; */ /* height: 550px; */ } }
-
In the image, it is not necessary to use a height or flex. When using
width: 100%
, the height adjusts automatically.kartu > img { /* flex: 2; */ border-radius: 15px; /* height: 100%; */ width: 100%; } @media screen and (max-width: 720px) { .kartu > img { /* height: inherit; */ } }
I hope you find it useful! ๐ Above all, the solution you submitted is great!
Happy coding!
Marked as helpful
@LuckyPort
Posted
@MelvinAguilar Thank you for the suggestion i really appreciate it was really help full. I'll applying your suggestion on another challenge โบ๏ธ