5 Images Flashcards
Add an image
Have text when the image is missing and for screenreaders
<img>
src attribute to point to the image location
alt attribute to provide text that describes the image (if image is just decoration leave empty text)
Have a title for an image (text that will show up when you highlight it
title=”title”
Set height and width of image (HTML)
height
width
( but images sizes is generally a CSS thing)
Make sure the space for the image is there for an image before the image is done loading (HTML)
height
width
( but images sizes is generally a CSS thing)
What does an image look like when you put it before the <p> tag, inside it at the beginning, or inside it in the middle
Img is an inline element.
Before, it’s above
In at beginning, on the same line as the text, text at bottom of image.
inside in middle, pushes line above up
(try it out to see)
Name some Block elements
div
p
h
more: https://www.w3schools.com/html/html_blocks.asp
Difference between block and inline element
Block elements always start on a newline
Inline elements do not
If an image is inline with a paragraph, make it go to the left or right and make text flow above and below it (with HTML, but don’t use it)
align attribute
it can be left or right
(don’t use this, use CSS. Just understand this for older code)
If an image is inline with a paragraph, make it go to the up, down or middle of the line it is in
align attribute
it can be top, middle, bottom
(don’t use this, use CSS. Just understand this for older code)
What format should web images be?
png, gif, jpeg
How big should images be (bigger than they appear?)
What px/inch should you assume
Should be the same size as they appear for optimal load times
Also take care of resolution. 72 px/inch
When should you use gif, png or jpeg?
Also in terms of transparency
jpeg for photos and images with lots of colours
GIF and png for fewer colours (like simple vector images and logos)
Gif alpha is only 1 or 0. Not good for rounded edges or translucency.
png alpha a range but png transparency not compatible with IE6
jpeg no alpha
what format for vector images?
svg
or canvas elements (make a vector from a rastor)
Make images a part of a figure, give caption
figure block element <figure> Insret the image Add the figcaption element (nestable but maybe that's pointless)