Design comparison
SolutionDesign
Community feedback
- @ChantalNgwenyaPosted about 2 months ago
Hey @SkMojid
1. Semantic HTML:
- Your HTML structure is mostly semantic, but there are a couple of improvements you can make:
- Instead of using a
<div class="hero">
around the image, consider using a more descriptive HTML5 element like<figure>
and<figcaption>
. This will help associate the image with the content more clearly. - The
<header>
and<footer>
tags are used well, but the social links inside the footer could be placed within a<nav>
element for better semantic structure, as they represent navigation links.
- Instead of using a
2. Accessibility:
- Alt Text: The alt text for the image is set to "Sk Mojid," but it should describe the person in the image (e.g., "Portrait of Jessica Randall") to be more meaningful to screen readers.
- Color Contrast: Your colors are mostly accessible, but you might want to double-check the contrast between the grey background (
--Grey-700
) and the white text. Tools like WebAIM can help ensure that the contrast ratio meets accessibility standards (minimum ratio of 4.5:1 for small text). - Focus States: Ensure that interactive elements like the social links have clear focus states. You can add
:focus
styles along with your:hover
styles to improve keyboard navigation accessibility.
3. Responsive Design:
- The layout looks well-suited for small screens due to the defined width (
310px
) of themain
element. However, it's important to test how this layout adapts to larger screen sizes. Currently, the design seems optimized for mobile or small devices but might need media queries to adjust for larger viewports. - Consider using
max-width
instead ofwidth
for themain
element to allow for flexibility across different screen sizes.
4. Code Structure and Readability:
- Your CSS is well-structured, and the use of variables makes it easier to maintain and change the design later. One minor suggestion would be to format the variable names consistently (
--Grey-700
and--Green
use different capitalization conventions). - In terms of reusability, your code is fairly modular, but you might want to consider breaking down the social links into a reusable component, especially if the project grows and you have multiple pages.
- The CSS selector for
li:hover a
could be optimized for readability by nestinga
insideli:hover
. This avoids potential confusion about the relationship between elements.
5. Design Consistency:
- The overall design looks close to the expected structure, but there are a few areas that might need minor adjustments:
- The social links are center-aligned, which fits the profile card style, but ensure that this layout remains consistent across screen sizes.
- The font size for different sections (e.g.,
h2
andp
) looks appropriate for mobile screens, but you might want to use media queries to scale the text size for larger screens.
Suggestions for Improvement:
- Add ARIA attributes to improve accessibility, especially for navigation links. For example, you can add
aria-label
to the social links for better screen reader support. - Add more media queries to enhance the responsive design on different screen sizes. This will allow the card to adapt gracefully to larger screens.
- Font family fallback: Consider adding a fallback font family to your
font-family: Inter
in case the Google Fonts API fails to load the font.
2@StroudyPosted about 2 months agoHey @ChantalNgwenya, Absolute solid feedback! 👏
0 - Your HTML structure is mostly semantic, but there are a couple of improvements you can make:
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord