Courses/Design & Technique-Essential Web Design/03

From Publication Station
Revision as of 11:22, 15 September 2015 by Andre (talk | contribs) (Created page with "=Styling your page with CSS= ==id and class attributes== Two of the most used attributes in HTML is id and class. They are important to distinguish and group different elem...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Styling your page with CSS

id and class attributes

Two of the most used attributes in HTML is id and class.

They are important to distinguish and group different elements. And become particularly important in CSS styling.

Note:

id

Ids cannot repeat in the same file. They are used to distinguish tags

The symbol for id is: #

<div id="square" style="background:black; color:red; width:400px; height:100px"/>

Id can server as a anchor (link) point within each page.

class

Classes can be used INFINITE TIMES in a file. They are used to group tags.

The symbol for class is: #

<p class="text">A</p>                                                           
<p class="text">B</p>                                                           
<p class="text">C</p>