hr width problems - Post ID 294319

User 2816895 Photo

9 posts

Hi , I'm working on … ions.html. I can style the <hr> by itself, but if I add the class attribute .blue, it will not recognize the styles. Also it will recognize the width in percentage, but not the height. why would that be?

.blue {

<hr class="blue"/>
User 122279 Photo

Senior Advisor
13,493 posts

After the word 'height' you need a colon, and at the end of the class .blue you need a '}'.
Ha en riktig god dag!
Inger, Norway
This site was made before we were able to create components through the app:
Component sharing for RFF, RBB, RSD and SD:
My work in progress right now:
Components for the same as above + HTML Editor:

User 2906089 Photo

Registered User
198 posts

If I understand correctly, you want a rectangle that goes from edge to edge that is 30px high? I would use a div instead and apply the sizes to that. Then you have access to the border properties as well. Correct your css and you are good to go.

<div class="blue></div>

User 379556 Photo

Registered User
1,186 posts

Both the above answers are, of course, correct.

The <hr> element has the slight advantage of being instantly recognisable when reading an .html file, and is pretty flexible when it comes to styling, as shown on the following pages:


Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.