HTML/CSS Service

Write a Clean CSS

Category: CSS, CSS Tips, CSS3 Tutorial    |    643 views    |    3 Comments  |   

 

Grouping Your Styles

Group your styles into categories (ex. layout, typography, forms, so on) and visually seperate them in your css file. A title and table of contents doesn’t hurt either:

/*
	csshook.com Screen Styles

	Table of Contents:
		layout
		typography
		forms
*/

/* layout
----------------------------------------------- */

/* typography
----------------------------------------------- */

/* forms
----------------------------------------------- */

Choosing Your Categories

Even though I do have some common practices, I don’t have a ‘template’ for how to breakdown styles into categories.

For starters, I almost always have layout and typography categories. Withtypography defining the sitewide look and feel. Depending on the complexity, I may break out the table and form styles into their own categories.

Next, I address the physical sections of the page with their own categories:headersidebarcontent, and footer for example. Lastly, I collect the page and content section specific styles and place them in their own category (and sometimes subcategories).

Importing Stylesheets

Another method is to categorize the styles and place them in seperate CSS files which are all imported by one main CSS file. I find this method good in theory but it can lead to overlapping styles, specification issues, and general confusion if you’re not very careful:

@import url("layout.css");
@import url("typography.css");
@import url("forms.css");

Linebreaks and Indenting Read more…

Share/Save/Bookmark

 

CSS Text Properties

Category: CSS, CSS3 Tutorial    |    340 views    |    Add a Comment  |   

 

letter-spacing

Possible Values:
number of pixels
normal
The letter-spacing property lets you Decide the amount of the space between letters in a section of text. The default is normal, but you can have a little fun if you want to….here is an example:

<DIV style=”letter-spacing:30px”>Each letter has 30 pixels between it and the next one.</DIV>

Now you will get some really spaced-out text!
Each letter has 30 pixels between it and the next one. Read more…

Share/Save/Bookmark

 

Advanced CSS (linking to an external style sheet)

Category: CSS, CSS 2 Tutorial    |    151 views    |    Add a Comment  |   

 

The advanced way, and the easiest way to do CSS is to link to an external style sheet. Here I will sow you how. If you are new to CSS, I reccommend reading the basic CSS tutorial first, if you haven’t already.

First, open up notepad and put all your styles in. One of the great things about external style sheets is that you don’t have to put in the <style> tags, just the code that normally goes in between them.

image 1 Read more…

Share/Save/Bookmark