Heading 1
WORK IN PROGRESS - TODO:
- microformats
- sitemap.xml (also useful for use with dutmeselectors firefox extension)
- progressive enhancement with child & adjacent sibling & attribute selectors
- browser testing
Phasellus sollicitudin dui at sapien. Aenean elementum, metus nec tincidunt tincidunt, sapien wisi auctor ante, sit amet elementum turpis tortor non elit. Morbi ultricies rutrum magna.
This is my HTML & CSS framework. The following is sample markup to demonstrate many common sets of data.
Heading 2
Phasellus sollicitudin dui at sapien.
Vestibulum class="what" gravida eros. Fusce lacinia urna vitae est mollis viverra. Proin a nunc vitae arcu convallis iaculis. Curabitur turpis. Integer lacinia erat nec nibh. Fusce purus dui, feugiat vitae, CSS tincidunt, blandit nec, quam. Donec euismod varius leo.
Praesent fringilla euismod leo. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Etiam at eros. Integer consectetuer pede et enim.
Praesent rutrum ipsum at justo. Quisque elementum lacus ac pede. In hac habitasse platea dictumst. Donec odio tortor, bibendum quis, auctor sed, bibendum eget, turpis. Etiam ac lorem sit amet ipsum convallis accumsan. Nulla id ipsum. Ut consectetuer, nunc id suscipit semper, sapien purus malesuada lectus, in tristique arcu augue quis lacus. Proin nec diam sit amet lorem commodo condimentum Donec nunc Proin ipsum leo, auctor a, dapibus non, lacinia auctor, odio. Vestibulum wisi mi, congue ut, lobortis accumsan, dictum et, wisi.
You can download somefile.zip . Here are some fake links to some Guidelines and a Report
Heading 3
- Mauris et justo.
- Fusce tincidunt felis in massa.
- Ut vel erat.
- Cras risus.
- Mauris lacus.
- Pellentesque a justo.
- Aliquam erat volutpat.
Heading 4
body, button, input, select, textarea {color:#666;font-family: "Frutiger", "Univers", "Helvetica Neue", arial, helvetica, sans-serif;}
Heading 5
| Description | Entity | Result |
|---|---|---|
| table footer header? | Data | Data |
| ampersand | & |
& |
| greater than | > |
> |
| less than | < |
< |
| copyright | © |
© |
| left single quote | ‘ |
‘ |
| right single quote | ’ |
’ |
| left double quote | “ |
“ |
| right double quote | ” |
” |
| pound | £ |
£ |
| euro | € |
€ |
| cent | ¢ |
¢ |
| multiply | × |
× |
| divide | ÷ |
÷ |
| Abbreviation | Description |
|---|---|
| B | Bytes |
| KiB | Kibibytes (1000 B) |
| MiB | Mibibytes (1000 KiB) |
| GiB | Gibibytes (1000 MiB) |
Heading 6
-
Praesent fringilla euismod leo. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Etiam at eros. Integer consectetuer pede et enim.
-
Praesent fringilla euismod leo. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Etiam at eros. Integer consectetuer pede et enim.
-
Praesent fringilla euismod leo. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Etiam at eros. Integer consectetuer pede et enim.
-
Praesent fringilla euismod leo. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Etiam at eros. Integer consectetuer pede et enim.
-
Praesent fringilla euismod leo. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Etiam at eros. Integer consectetuer pede et enim.
-
Praesent fringilla euismod leo. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Etiam at eros. Integer consectetuer pede et enim.
-
Praesent fringilla euismod leo. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Etiam at eros. Integer consectetuer pede et enim.
-
Praesent fringilla euismod leo. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Etiam at eros. Integer consectetuer pede et enim.
Error
Cras erat. Praesent gravida, arcu vel fermentum rutrum, dui leo bibendum sem, ut pharetra eros eros et lacus. Proin pretium laoreet elit.
Warning
Cras erat. Praesent gravida, arcu vel fermentum rutrum, dui leo bibendum sem, ut pharetra eros eros et lacus. Proin pretium laoreet elit.
Success
Cras erat. Praesent gravida, arcu vel fermentum rutrum, dui leo bibendum sem, ut pharetra eros eros et lacus. Proin pretium laoreet elit.
Style guidelines
- selector {
- declaration block
- }
- selector,
- selector {
- declaration
- declaration
- declaration
- }
- #id element.class element {
- property: value;
- property: value;
- property: value;
- }
- #example-id div.example-class p {
- color: #f00;
- padding: 0 10px;
- }
the rules would be applied to the following HTML.
- <div id="example-id">
- <div class="example-class another-class">
- <p>content</p>
- </div>
- </div>
If the same property is defined multiple time it will use the last defined property of the strongest level selector. The strength is calculated by concatenating the following:
- # of ids
- # of classes
- # of elements
- #example-id { /* 100 */
- property: value;
- }
- div.example-class { /* 011 */
- property: value;
- }
- div.another-class { /* 011 */
- property: value;
- }
- div { /* 001 */
- property: value;
- }
In anticipation of HTML 5 the following classes should be used:
| HTML5 | HTML4 / XHTML1 |
|---|---|
<header> |
<div class="header"> |
<nav> |
<div class="nav"> |
<article> |
<div class="article"> |
<section> |
<div class="section"> |
<aside> |
<div class="aside"> |
<footer> |
<div class="footer"> |
<dialog> |
<dl class="dialog"> |
<figure> |
<div class="figure"> |
If an id is given to an element it should be unique for that page.
Zero values do not require a unit of measurement: 0px == 0pt == 0em == 0
Keep declarations in each rule sorted alphabetically by its property. This improves readability and reduces the chances of setting a property more than once.
Add a line-break after the comma when using multiple selectors in one rule unless all the selectors are single elements. Example:
- div.content h1,
- div.content h2 {
- color: #f00;
- }
- h1, h2 {
- color: #f00;
- }
Use shorthand where appropriate. (margin, padding, border, background)
- padding: (TOP) (RIGHT) (BOTTOM) (LEFT);
- padding: (TOP) (RIGHT & LEFT) (BOTTOM);
- padding: (TOP & BOTTOM) (RIGHT & LEFT);
- padding: (TOP & RIGHT & BOTTOM & LEFT);
- padding: 2px 1px 0 1px;
- ==
- padding: 2px 1px 0;
- padding: 5px 8px 5px 8px;
- ==
- padding: 5px 8px;
- padding: 3px 3px 3px 3px;
- ==
- padding: 3px;
- color: #ff0000;
- ==
- color: #f00;
- background-color: #f00;
- background-image: url(images/example.png);
- background-repeat: repeat-x;
- background-position: 50% 10%;
- ==
- background: #f00 url(images/example.png) repeat-x 50% 10%;
End declarations with a semi-colon (;) even though it is not strictly necessary for the last declaration of the declaration block.
Avoid over declaring. Make the most of the fact that styles do/can inherit. For example avoid setting fixed widths on everything. Block level elements naturally expand to fill the width of their container. Use margins and padding instead so that if the width of the main container is changed all the widths will flow to fill their parents.
Make the styles work in Firefox/Safari first then IE6/7. Use !important or hacks as a last resort. IE conditional comments can be added to the HTML to import IE6/7 specific style sheets if necessary.
Pixel perfection in all browsers should not be the main priority.
Avoid specifying font-size in px. The better alternative is em. This allows text resizing in IE6. It also means that fonts will be relative to their containers. So if a site-wide font-size increase was necessary it would only require changing one property.