I find Web Development quite satisfying and enjoy doing the front end I have a good understanding of HTML, CSS, JavaScript, and React. I look forward to learning a lot from every challenge and the community.
I’m currently learning...React React Router, Redux, API, Backend Integration
Latest solutions
Social media dashboard with theme switcher built with React
#accessibility#react#vite#web-componentsSubmitted almost 2 years ago
Latest comments
- @dxiDavidSubmitted almost 2 years ago
- @dxiDavidSubmitted about 2 years ago@dxiDavidPosted about 2 years ago
I'm not sure why the screenshot makes it look so stretched out 🤔. The live view looks just fine.
0 - @Julian-CarlosamaSubmitted about 2 years ago@dxiDavidPosted about 2 years ago
Hello @Julian-Carlosama 👋🏾
Congrats on completing the challenge 🎉
I have a few suggestions on how you can improve your code:
1. HTML📃
- Make sure your content is wrapped inside a
<main>
landmark tag. If you want to learn more about semantic HTML tags you can find that here. - Make sure that your images have
alt
text for screen readers which will improve accessibility for your future websites. Try to have descriptive text so that the person knows exactly what the image is.
2. CSS📄
- Avoid setting fixed values for dimensions like
width
andheight
. Instead set amax-width
andmax-height
for your elements - Avoid using absolute units like
px
for anything other than border-radius or box-shadow. Use responsive units likeem
andrem
which will make your projects more responsive. - To center your card you can try the following methods
- Using grid
body{ min-height: 100vh; display: grid; place-items: center; }
- Using flexbox
body{ min-height: 100vh; display: flex; flex-direction: column; justify-content: center; align-items: center; }
Another useful tip is to build a habit of setting custom properties for the styles found in the style guide and any other styles you might re-use.
You might also want to set up utility classes for centering things to avoid repeating yourself throughout the code.
Your solution looks great
I hope you found this helpful 😁
Happy Coding 🥂
Marked as helpful1 - Make sure your content is wrapped inside a
- @WiaterKaSubmitted about 2 years ago@dxiDavidPosted about 2 years ago
Hello @WiaterKa 👋🏾
Congrats on completing the challenge.
To solve your centering problem, try wrapping everything in a wrapper div or main container and center it using flexbox or grid.
body { background-color: hsl(210, 46%, 95%); margin: auto; display: flex; justify-content: center; align-items: center; min-height: 100vh; width: 1100px; height: 572px; }
For the above code you've written, declare a
min-height
first then use flexbox. Please do not give the body a fixed height or width after. The auto margin is also unnecessary.One last thing, avoid using pixels for dimensions, font sizes, or spacing. You're better off using
em
orrem
.I hope you found this helpful, happy coding🥂
Marked as helpful2 - @JavierRiv97Submitted about 2 years ago@dxiDavidPosted about 2 years ago
Hello @JavierRiv97 👋🏾
The exact font sizes are for pro members otherwise, use your knowledge of CSS and best judgment to get as close as possible to the design. Don't worry though, It's not that hard.
Also, ensure that your projects meet accessibility requirements by adding alt text to your images for screen readers.
Make sure that your Body content is wrapped in landmarks like
<main>
or<article>
. You can find out more on semantic HTML hereHappy coding🥂
0 - @Akiraz14Submitted about 2 years ago@dxiDavidPosted about 2 years ago
Hello there @Akiraz14 👋🏾
I have a suggestion that will help you write better code
- when setting custom properties, try giving them descriptive names like
--primary-font-color
instead of--color-1st
. It will make your CSS easier to read and understand. Also, try to set custom properties for styles such asfont-size
,font-weight
, (basically things you see in the style guide)border-radius
since they will most likely be used on more than one occasion. - Limit the use of pixels to things like
box-shadow
andborder-radius
, otherwise use relative units. - only look for references when you are absolutely stuck and cannot find a way out. don't waste time doubting yourself. If you have a working solution then good. come back and refactor later
The attention to detail in your solution is impressive💪🏾
Keep Going, happy coding🥂
Marked as helpful1 - when setting custom properties, try giving them descriptive names like