Friday, 20 October 2017

CSS-Class Name.

Class Name

CSS is not limited to selecting elements by tag name. HTML elements can have more than just a tag name; they can also have attributes. One common attribute is the class attribute. It's also possible to select an element by its class attribute.
For example, consider the following HTML:
<p class="brand">Sole Shoe Company</p>
The paragraph element in the example above has a class attribute within the <p> tag. The classattribute is set to "brand". To select this element using CSS, we could use the following CSS selector:
.brand { }
To select an HTML element by its class using CSS, a period (.) must be prepended to the class's name. In the example above case, the class is brand, so the CSS selector for it is .brand.
Share:
Categories

2 comments: