reading-notes

https://faroukibrahim-fii.github.io/reading-notes/

View the Project on GitHub FaroukIbrahim-FII/reading-notes

HTML Images; CSS Color & Text

Images

Choosing Images for Your Site

A picture can say a thousand words, and great images help make the difference between an average-looking site and a really engaging one.

Storing Images on Your Site

If you are building a site from scratch, it is good practice to create a folder for all of the images the site uses.

Adding Images

<img> to add an images into page you need to use an <img> element. This is an empty element (which means there is no closing tag).

image

Three Rules for Creating Images

There are three rules to remember when you are creating images for your website which are summarized below. We go into greater detail on each topic over the next nine pages.

  1. Save images in the right format.

  2. Save images at the right size.

  3. Use the correct resolution.

Image Di mensions

The images you use on your website should be saved at the same width and height that you want them to appear on the page.

HTML5: Figure and Figure Caption

Images often come with captions. HTML5 has introduced a new <figure> element to contain images and their caption so that the two are associated.

You can have more than one image inside the <figure> element as long as they all share the same caption.

Color

Foreground Color

The color property allows you to specify the color of text inside an element. You can specify any color in CSS in one of three ways:.

Contrast

When picking foreground and background colors, it is important to ensure that there is enough contrast for the text to be legible.

Text

Typeface Terminology

text

Choosing a Typeface for your Website

When choosing a typeface, it is important to understand that a browser will usually only display it if it’s installed on that user’s computer.

Specifying Typefaces

The font-family property allows you to specify the typeface that should be used for any text inside the element(s) to which a CSS rule applies. The value of this property is the name of the typeface you want to use.

The people who are visiting your site need the typeface you have specified installed on their computer in order for it to be displayed.

Type Scales

You may have noticed that programs such as Word, Photoshop and InDesign offer the same sizes of text.

Alignment

The text-align property allows you to control the alignment of text. The property can take one of four values:

Attribute Selectors

You met the most popular CSS selectors on page 238. There are also a set of attribute selectors that allow you to create rules that apply to elements that have an attribute with a specific value.

JPEG vs PNG vs GIF

There is a significant difference in the number of colours that can be supported by these 3 formats.