Summary 6

HTML Media and CSS Styling

Topic 1 - Using style is better than heigh or width.

When specifying the size of an image, using the style attribute helps prevent style sheets from altering the image size. Alternatively, you can use the width and height attributes to define the exact dimensions of the image. If the image does not display, using the alt attribute to provide a description is helpful.

Topic 2 - Using CSS colors

You can change the color of various elements using CSS. When selecting a color, you can use a color name, but it may not appear the same across all browsers. To ensure consistent color display on your website, use a HEX or RGB code to define it. For example, "light blue" may look different on Chrome than on Firefox. This is especially important when using brand colors.

Topic 3 - CSS backgrounds

You can apply opacity to backgrounds by using the opacity property with a percentage converted into a decimal. When using the background-color property, keep in mind that it affects the entire element, including everything between the opening and closing tags.