Classes and ID's
Classes ans IDs exist in HMTL to help elements interacy with and be manipualted by CSS sel;ector. Classes and id's are usually declared using the class= or id= attribuyes.
This is a paragraph with a class of 'class-para'.
This is a paragrah with an id of 'id-para'.
In CSS, classes are selected using a dot (.) and IDs are selected using a (*).
When using CSS to syle HTML
elements, you should always use an external. Unless it is for demo purposes, you should never write CSS direcetly into an HTML document.
Block and Inline
In HTML and CSS, there are two types of elements. Block elements and inline elements. Block elemnts take up the entire width of a box. Inline elements, flow on the same line.
Examples of block elements: p,div,ul,ol,li,h2,h3,h4,h5,h6
Exmaples of inline elements: span, a img,strong,e,
Samples of Block Elements
- ul and li elements are block elements.
- They stand for unorderedx list, and list item.
Headings (h1-h6) are block elements
Samples of inline elementsThis us an inline. Google"
Websites are composed of mutltiple HTML pages that all share the same stylesheet. These different pages, are often linked together to form a navigation system for the website.
It is typical, that the index.html file is used as the homepage for a website. This is because most browsers will search out an index.html file to display first.
Usually, it is recommend, that different pages of the same website share the same styling and overall structure. So, it is not uncommon for a designer/developer to copy code from the index.html file onto their sub or secondary pages.Go to About Page