The Img Tag

The img tag

-html -img -freecodecamp
Author

Kevn Gilds, MPA

Published

2023-05-25

I have been working on the Responsive Web Design course from freeCodeCamp.

I seem to always have to look up the img tag.

Per W3 School on html tags

The attributes of the img element are as follows:

<img id="logo" src="https://cdn.freecodecamp.org/platform/universal/fcc_primary.svg">

This example does not have the alt attribute.

Below is the css to manipulate the size of the image.

body {
  background: #f5f6f7;
  color: #1b1b32;
  font-family: Helvetica;
  margin: 0;
}

header {
  width: 100%;
  height: 50px;
  background-color: #1b1b32;
  display: flex;
}

#logo {
  width: max(100px, 18vw);
  background-color: #0a0a23;
  aspect-ratio: 35 / 4;
  padding: 0.4rem;
}

About

Kevin is a nonprofit data professional operating out of Lakeland, Florida.
My expertise is helping nonprofits collect, manage and analyze their program data.