CSS - Cascading Style Sheets

Images and their Borders

Images in HTML are visual ressource displayed on a web page using the tag. Another element called "border" is a visual line drawn around any element to emphasize, separate, or decorate content.

Borders are important because they add visual impact and effects to elements like images.

<img />

The image tag is used to display an image in a web page. It has two "required" attributes :

src= → Path or URL to the image file
alt= → Alternative text describing the image

Filling the alt attribute is important as it improve accessibility, is used for SEO, and as fallback when the image cannot be loaded.

border:

Shortand CSS property used to define border width, border style and border color.

→ ex: border: 1px dashed red;

Common style value :

solid; → single line
dashed; → broken line
dotted; → series of dots
double; → two parallel lines
none; → no border