View on GitHub

Code Fellows reading notes

A repository for organizing notes from my learning.

Images, Colors, and Text

Images (HTML)

Including Images in a Website

It’s good practice to place your website images in a folder made for that purpose. They are added to your HTML using the <img /> element, which includes the following attributes:

Aligning images should be accomplished with CSS but, the align attribute was once commonly used to indicate how other content should be organized around an image. This is now more commonly accomplished using the display: CSS property.

It is helpful to know which image format is best for saving images:

HTML5 Figures

The <figure> and <figcaption> elements can be used to render images with a caption below them.

The <figure> element acts as the parent to an <img> and <figcaption>, allowing them to be grouped together. Before HTML5 there was no way to directly associate an image with its caption.

Colors (CSS)

Colors are what gives a page its personality and there are many tools we can use to apply colors to a web page:

color: - applies a color to the text of an element. Can accept RGB, Hex, RGBA (CSS3), HSL(CSS3), or one of 147 predefined color names. background-color: - Changes the background color of an element. Not specifying a background color will set a background to transparent. Accepts the same values the color property. opacity: - a number between 0.0 and 1.0 used to define how opaque and element is. 0.0 is transparent, 1.0 is fully opaque.

It’s important to consider contrast when defining colors for a website. High or medium contrast text is easier for humans to read, and medium contrast or light text on a dark background benefits from spaced out font for ease of reading.

Text

There are generally 3 different typefaces:

CSS allows us to change the font to fit our needs:

Links can be styled using the :link and :visited pseudo-classes. These allow us to control how a link looks before and after it has been visited by a user.

There are other pseudo-classes that can be used to provide a feeling of interactivity to the user:

NOTE: when pseudo-classes are used they should be in this order: :link, :visited, :hover, :focus, :active