Classes and IDs

classes and IDs exist to help elements interact with and be manipulated by CSS selectors. classes and IDs are usually declared using the class= or id= attributes.

This is a paragraph with a class of 'class-para'.

This is a paragraph with an id of 'id-para'.

it is standard compliant to use id\only classes for styling in CSS. only when you are working with javascript elements do IDs come in handy. it is a good idea for CSS styling that you stick to using classes only.

In CSS, Classes are selected using a dot (.) and IDs are selected using a (#).

Using CSS with HTML

When using CSS to style HTML elements, you should always use an external stylesheet. Unless it is for demo purposes, you should never write CSS directly into an HTML document.

Block and Inline

Block elements take up the entire widthof a box. Inline flows on the same line.

Examples of block: p, div, ul, , ol, li, h1-h6

Inline examples:span, a, img, strong, em

Samples of Block Elements

Samples of Inline Elements

This is Inline. Google

Linking HTML pages and working with multiple pages

index.html file is compliant for homepage.

it is recommended that different pages share same styling and structure. so it is not uncommon to copy codes.

Go to About Page