CSS & CFM: Alphabet Soup or Best Friends Forever?
Building websites that leverage the flexibility of CSS and the power of CF.
You can follow along with this presentation online using Acrobat Connect.
Topics to cover:
- Quick coverage of HTML elements (block level elements and inline elements)
- Block Level Elements
- Common block level elements: P, DIV, FORM, TABLE, H1-H6, UL/OL, and PRE [EXAMPLE]
- Block Level elements are used to contain inline and other block level elements.
- Characteristics of a block level element
- Default width is 100% of it�?s available space
- Block level elements begin and end on new lines which means that to have multiple block elements appear on the same horizontal plane, you must use CSS (or a built in attributes such as align attribute in the TABLE, P and H tags). [EXAMPLE]
- Inline Elements
- Common inline elements: A, B, IMGs, INPUT, SPAN, SMALL, and BIG [EXAMPLE]
- Inline elements are generally wrapped around content on a page to alter it�?s appearance or functionality
- Use the A tag to create a link from one document to another.
- Use the B tag to alter the appearance (and meaning) of a string of text.
- IMG tag allows visual elements to be used on a page
- INPUT, SELECT, and TEXTAREA offer the end-user the ability to interact with the page or site they�?re viewing.
- Characteristics of an inline element
- In most cases inline elements occupy only enough space to surround the content contained within them [EXAMPLE]
- Most Inline elements have visual clues built into them such as the B, the I and the A tags.
- Use
- Use
- The reason for covering the basics it to make sure you understand what built-in properties and attributes HTML elements already have. For example, there�?s no reason to apply a bold font weight style to a B tag as it already appears that way. Similarly, there�?s no reason to style a span tag around the your company name only to make it bold (<span style="font-weight: bold">your company</span>) because the bold tag already handles that.
- Review basic presentational styles, such as:
- Structural styles
- Position
- difference between relative and absolute
- left, right, bottom and top
- Width and height
- Margin and padding (and the difference)
- possibly explain the box model here?
- http://www.w3.org/TR/REC-CSS2/box.html
- Presentational styles
- Border
- Font
- Background
- Color
- Text-align
- Review a basic document structure. Mention W3 validation, the fact that it�?s a clean slate for CSS markup.
- Walk through the main example file without formatting, or with formatting
- Coldfusion and CSS
- Use a cfm file as your �?stylesheet�?.
- <link href="includes/styles.cfm" rel="stylesheet" type="text/css" />
- allows you to dynamically set the styles for that file using whatever CF logic you choose. In my custom CMS, I store hex values for every aspect of the site in the database. Then I pull them and store them in the application scope. Once there, I can reference that value anywhere. So I dump them into the stylesheet.
- References
- Attribute selectors: http://www.stuffandnonsense.co.uk/archives/css_a_tribute_to_selectors.html
- Styling tables with CSS: http://www.somacon.com/p141.php