Declaring a class attribute to open tag

Can I add a class attribute to the tag, also how would you add special characters to the hr tag ? The reason I’m asking is because I want create different designed webpages and also create a fancy decorative line using symbols instead of the regular block line.

<html lang="en" class="sled">
<hr style: line-type: &#9790 &starf &# 9789>

You can add a class to any element.

Technically, the hr element can’t have any content but I do believe that you can get away with adding characters using :before and :after pseudo-elements and most browsers will show them. I’m not sure how that would affect people using assistive technology, such as screen readers? But depending on what you want to do that might not give you the flexibility you are looking for. I think most people use background images to display fancy separators.

Concerning your hr element above, if you are trying to embed CSS in the HTML element then you would change it to:

<hr style="line-type: &#9790 &starf &# 9789">

But I don’t think I’ve ever seen the line-type CSS property and google doesn’t seem to be finding it either. Can you explain a little more what you are trying to do?

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.