View on GitHub

reading-notes

CodeFellows Class Reading Notes

HTML Ch. 5 - Images

Images on a webpage should:

To add an image, use the format:

<img src="images/example.jpeg" alt="An example of alt text for an image" title="Example Title" />

src tells the browser where to find the image file
alt provides a text description of the image
title is an attribute that provides additional information

An image element can also include the height and width attributes to specify size

If an image is followed by a block level element, then that element will sit on a new line after the image.

If an image is placed inside a block level element then any text or other inline elements will flow around the image.

Three important rules for creating images are:

  1. Save images in the right format (usually .jpeg, .gif, or . png)
    • Photographs are best as .jpeg
    • Illustrations and logos with flat colors are best as .gif
  2. Save images at the right size (ideally, the size that you want them to appear on the website)
  3. Use the correct resolution

<figure> elements contain images and their captions, and can contain more than one image as along as they all share the same caption

<figcaption> element is used to add a caption to an element


HTML Ch. 11 - Color

RGB Values express color in terms of how much red, green and blue are used

rgb(100,100,90)

Hex Codes express color in six-digit codes that represent red, green and blue. They are expressed with a leading #

#ee3e80

Color Names are predefined and recognized names in vernacular

DarkCyan

HSL Colors refer to hue, saturation and lightness

Opacity describes whether a color is solid or not, and to what degree it can be seen through. This attribute can be appended to an rgb or hsl value by adding a fourth number, expressed as rgba or hsla respectively


HTML Ch. 12 - Text

Typeface Terminology

Serif: fonts with extra details on the ends of main strokes of the letters

Sans-Serif: fonts with straight ends to letters and a cleaner design

Monospace: Fonts where every letter is the same width

Weight adds emphasis and affects the amount of whitespace and contrast on a page (such as bold or normal)

Style include Italic and Oblique

Stretch describes how condensed or extended letters are

font-family property allows you to specify the typeface to be used

font-size property allows you to specify the size of the font in pixels, percentages (as compared to the default of 16px) or ems (the width of the letter ‘m’)

@font-face can be used to introduce a font that may not be installed normally - if a user does not have the font, this will download the necessary font onto the users’ machine. It includes the attributes font-family, src and format

text-transform can be used to change the case of text into UPPERCASE, lowercase or Capitalize

text-decoration includes several options:

line-height sets the height of the entire line of text

letter-spacing & word-spacing are similarly self explanatory

text-align can be set to left, right center or justify

vertical-align is used with inline elements to perform a task similar to the HTML align attribute used on <img> elements. It can be set to:

text-indent affects only the first line of text within an element

text-shadow creates a drop shadow and can take 3 values:

Pseudo-Elements (specified at the end of a selector)

Attribute Selector Format Meaning
Existence [ ] Matches a specific attribute (whatever it’s value)
Equality [=] Matches a specific attribute with a specific value
Space [~=] Matches a specific attribute whose value appears in a space-separated list of words
Prefix [^=] Matches a specific attribute whose value begins with a specific string
Substring [*=] Matches a specific attribute whose value contains a specific substring
Suffix [$=] Matches a specific attribute whose value ends with a specific string

Home