DEV Community

Charity Parks
Charity Parks

Posted on

How to add an image to your website using HTML...

Adding images to your web page can really make it stand out. When you find the right image, it just pops! You can find images on such sites as www.istockphoto.com or www.gettyimages.com. You will want to create an 'images' folder to store them in.

You will need to use the <img> element and it must include two attributes:

  1. src : This tells the browser where your image is being stored
  2. alt : This is where you can add text to show in place of the image if for some reason the image fails to show up on your web page. For example, "Image of Company Logo". The <img> tag doesn't need a closing tag.

Your image is added like this:

<img src="images/dog.jpg" alt="A picture of a dog" />

You can add things like height and width to them by adding on to the above example.

<img src="images/dog.jpg" alt="A picture of a dog"
width="600" height="450" />

You can also add images by using CSS using background-image property. But thats for another day! Happy coding!

Sentry blog image

How to reduce TTFB

In the past few years in the web dev world, we’ve seen a significant push towards rendering our websites on the server. Doing so is better for SEO and performs better on low-powered devices, but one thing we had to sacrifice is TTFB.

In this article, we’ll see how we can identify what makes our TTFB high so we can fix it.

Read more

Top comments (0)

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay