CSS: the Basics
CSS, or Cascading Style Sheets, formats and customizes HTML or other
files in markup language. With CSS, coders can change the layout, font,
colors, and other design elements of a webpage. Coders can ascribe
attributes such as "class" or "id" in HTML in order to apply the markup
to specific parts of the HTML document. CSS uses a combination of
brackets like "{}" and semi-colons to create lists of attributes for style
elements.
Common CSS Attributes
- "padding" - space between border and content
- "border" - adds a border around content
- "font-family" - type of font, such as sans-serif
- "text-decoration" - adds things like underlines to fonts
- "float" - allows elements to move independently in the layout, such as right or left
- "background-color" - adds color to the background, designated by the hexcode
- "height" or "width" - defines height and width for elements such as tables or images
Getting Started
Like HTML, coders write CSS in a text editor such as Textwrangler for OSx. The HTML file must link to the appropriate CSS file, and the CSS file must be saved with ".css" as the file extension.
