readingnotes

View project on GitHub

Read07

  • CSS allows you to create rules that specify how the content of an element should appear. For example, you can specify that the background of the page is cream, all paragraphs should appear in gray using the Arial typeface, or that all level one headings should be in a blue, italic, Times typeface. -CSS works by associating rules with HTML elements. These rules govern how the content of specified elements should be displayed. A CSS rule contains two parts: a selector and a declaration. -CSS declarations sit inside curly brackets and each is made up of two parts: a property and a value, separated by a colon. You can specify several properties in one declaration, each separated by a semi-colon. -The element can be used in an HTML document to tell the browser where to find the CSS file used to style the page. It is an empty element (meaning it does not need a closing tag), and it lives inside the <head> element.
  • When building a website there are several advantages to placing your CSS rules in a separate style sheet. -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:rgb values These express colors in terms of how much red, green and blue are used to make it up.hex codes:These are six-digit codes that represent the amount of red,green and blue in a color,preceded by a pound or hash #sign.There are 147 predefined color names that are recognized by browsers. -Every color on a computer screen is created by mixing amounts of red,green, and blue. -It is important to ensure that there is enough contrast between any text and the background color (otherwise people will not be able to read your content).