Design comparison
Community feedback
- @Munsif-AliPosted over 1 year ago
It look like you have given the wrong path of the image. To give a relative image source (src) in HTML, you can specify the image's location relative to the HTML file's location. Here are some examples:
- If the image is in the same directory as the HTML file:
<img src="image.jpg" alt="Image description">
- If the image is in a subdirectory called "images" in the same directory as the HTML file:
<img src="images/image.jpg" alt="Image description">
- If the image is in a parent directory called "images" relative to the HTML file:
<img src="../images/image.jpg" alt="Image description">
In the second example, the "../" notation indicates that the file is located one directory level above the current directory. In the third example, it is located two levels above.
Note that the actual path may differ depending on your file structure, so make sure to adjust the relative path accordingly.
In HTML, images should always include alternative text, also known as "alt text," to provide a textual description of the image for users who cannot see the image, such as those who use screen readers or have images turned off in their browser.
If you are encountering an error message stating that images must have alternate text, it means that you have not included the required "alt" attribute in the image tag. To fix the error, simply add the alt attribute to your image tag and provide a brief but descriptive text that accurately describes the content and purpose of the image.
Here's an example of an image tag with the alt attribute:
<img src="example.jpg" alt="A red apple on a white background">
In this example, the alt text describes what the image depicts, allowing users who cannot see the image to understand its content.
Marked as helpful1@ninoslat1Posted over 1 year ago@Munsif-Ali thank you for the feedback, actually the image is worked in my local website, but somehow it doesn't worked when i upload it to github pages. Again, thank you for the feedback Sir. Have a nice day ❤
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