What does .hero a mean


Replace this line with your code.


dot indicates a className selector. .hero would indicate a class attribute in an HTML element with the name, "hero", as in,

<img class="hero" src="superman.png" />

In the style sheet we could give this element special properties.

img.hero {
    width: 200px;
    border: 2px solid blue;
    border-radius: 50%;

That will crop our image into a circle and give it a blue border. It also defines the width and height properties so those attributes may be left out of the <img /> tag. In the above we specified the element tag name in the selector because a class may be applied to several elements in the page. This rule will only apply to images with the class.


This topic was automatically closed after 7 days. New replies are no longer allowed.