In CSS, a simple selector starting with a period (.
) represents elements that have a certain class. For instance the rule.highlighted {background-color: yellow;}
will apply to all elements that have the class “highlighted”, such as
<p class="highlighted"> ... </p>
<hr class="highlighted"> ... </p>
<aside class="highlighted"> ... </p>
or in wikitext to such things as
All of these elements will get the background color yellow. (Assuming no other rules override it; look up “specificity” and “the cascade” in a CSS reference for details.)
You can alternatively apply selectors to specific elements types, with rules like this:
p {background-color: pink;}
hr {background-color: green;}
This says that all paragraph (P elements should get a pink background, and all horizontal rule (HR) elements should be green.
You can combine these by putting the period for the class right after the element name. This:
table.highlighted {background: blue}
says that all table elements that have the class “highlighted” must get our blue background.
There’s lots more to CSS. The MDN page is a good reference, and tutorials are everywhere.
For your case, it’s not clear to me what you do and don’t want.
If you want this fade in and out gradient to apply to multiple elements, then use a selector like
.style-one { ... }
and add the class to the HTML tag.
If you want it to apply to all <hr/>
elements everywhere, then use
hr { ... }
And if you want it to apply to only some of the HRs, then combine the two:
hr.style-one { ... }
and again add the class to the HTML tag where you want it (or handle it in wikitext with the @@
notation.)
By the way, “style-one” is a terrible name. Try to choose a name that’s a succinct description of why you want the style, of what you want to convey with it, perhaps <hr class="subchapter-divider">
or <hr class="fancy">