Sunday, October 23, 2011

Week 9: CSS

CSS:
  • made HTML easier by having a separate area for formatting code (the design elements)
  • saved a lot of time in designing web pages for developers
  • a rule is a line of code that states the style of the particular element
  • CSS is broken down to two parts: the selector and the declaration
    • the selector tells the computer the area to modify (the body, paragraph etc.)
    • the declaration specifies what you want to change or add
      • the declaration is split into two parts (split by a colon) the property and value
        • the property specifies the style like color or font and the value specifies the specific of that style like font size or the actual color. 
      • declarations can be grouped together, separated by a semi colon, if more than one style is applied to the same element
      • it is also possible to group together elements that you want to apply one style to, for example head 1, head 2 and head 3 all need to be in bold
  • there is also the ability to add in your own comments into the coding, this lets you have the ability to look back at the code and know exactly what it is intended for if you want to make adjustments later
  • id selector-lets you add a style to just one element
  • class selector-lets you add a style to a group of elements
  • there are 3 ways of adding CSS
    • externally - consists of one file that can be applied to multiple pages
      • does this by including code on the page that will link back to that file
    • internally - there is one page that has it's own style
    • inline - not advisable to use because the style is included in the tag
  • backgrounds - allows you to customize the background of the page
    • color is described depending on the type of color it is ex. RGB
    • can add an image, CSS will repeat the image so it will cover the whole area
    • CSS will also allow you to add text, font type, color, alignment, decorations, links, tables etc to the background as needed by your design
  • browsers - must use a browser that recognizes CSS
    • this can be a trial and error process to find the right browser and CSS that can work together, can be buggy
  • inheritance - elements in HTML will inherit the styles from the CSS style sheet
  • Basically CSS is the creative force behind web page designed.  It was established to make the process easier and separate from building the web page content that HTML is set up for.

No comments:

Post a Comment