Alice
Alice

Reputation: 633

How to format horizontal rules?

I want to have many horizontal rules with the same formating.
I'm trying with CssClass and got an error:

<hr CssClass="hRules"/>  // error: Attribute 'CssClass' is not a valid attribute of element 'hr'.

What is the solution, please ?

Upvotes: 0

Views: 413

Answers (2)

Shadowxvii
Shadowxvii

Reputation: 1120

For normal HTML controls, you must use the class attribute. The CssClass attribute is used for asp controls. You could probably still use the CssClassattribute for your hrcontrol, but you would probably have to set it a runat="server"too

Upvotes: 1

t3rse
t3rse

Reputation: 10124

Can you not simply use the class attribute?

<hr class="hRules" />

And in Css somewhere:

.hRules{
   height:1px;
   color:#C7C7C7;
}

Upvotes: 1

Related Questions