Design comparison
Community feedback
- @biwwabongPosted 2 months ago
Th html is only partially semantic.
Semantic elements:
<html>: This is a semantic element that defines the root of an HTML document. <head>: This is a semantic element that defines the document's metadata. <title>: This is a semantic element that specifies the document's title. <img>: While img itself isn't inherently semantic, the alt attribute provides alternative text for the image, making it accessible. <p>: This is a semantic element that defines a paragraph of text. <a>: This is a semantic element that defines a hyperlink.Non-semantic elements:
<div>: The div element is a generic container and doesn't convey any specific meaning.Possible changes:
In your code, you could potentially use more semantic elements like <section> or <article> depending on the intended structure.
Here's how you can improve the semantic nature of the code:
Replace the outer div with a more specific element. If it represents a card-like structure, you could use <section class="card">. If the content within the card represents a call to action, you could consider using <article class="card">.
By using more semantic elements, your code becomes clearer to both humans and machines (like screen readers). It also enhances the maintainability of the code in the long run.
Marked as helpful0@MuhammadSaud60Posted about 2 months ago@biwwabong Thanks for your suggestion I will use semantic tags in my next Project.
0
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