HTML and CSS 101

 

Starting with HTML 4.0, in an attempt to return HTML back to a pure content mark up and separate out styles, cascading style sheets were introduced and CSS declaration syntax in HTML was standardized.

CSS declarations are pretty straightforward — one or more key-value pairs, separated by semi colon in curly braces applied to an HTML element. The HTML element is called the selector. More here http://www.w3schools.com/css/css_syntax.asp

Now, the tricky part on selectors. The hash and the dot.

You can restrict CSS formatting to a HTML element with a specific ID by using the #ID syntax.

E.g., if you have an HTML element called para1, you can restrict CSS to #para1.

On the other hand, if you want to apply the style to all elements, such as Center element in HTML, use the .Center.

Again more info here http://www.w3schools.com/css/css_id_class.asp

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s