If you were to use a horizontal line and want to make it a certain color, how would you also make its width different? I can't wrap my head around THIS one. for example: --<HR COLOR="#00FF00"/> This makes it green, but I can't add width in there. is there some certain way? | Sololearn: Learn to code for FREE!
0

If you were to use a horizontal line and want to make it a certain color, how would you also make its width different? I can't wrap my head around THIS one. for example: --<HR COLOR="#00FF00"/> This makes it green, but I can't add width in there. is there some certain way?

24th Oct 2016, 2:30 PM
Thomas Campbell
Thomas Campbell - avatar
7 Answers
+ 3
<hr style="width:100px;"/> With the style="" Attribute you can do that, but it is better to make a class and define it in the CSS File.
24th Oct 2016, 3:58 PM
Fronz-Tec
Fronz-Tec - avatar
+ 3
you can make <hr style="color:#00FF00;width:100px;"/> But define the Style inside the CSS File is more recommended hr { color: #00FF00; width: 100px; } so the page will load faster.
24th Oct 2016, 4:13 PM
Fronz-Tec
Fronz-Tec - avatar
+ 2
This is also possible.
26th Oct 2016, 4:50 AM
Fronz-Tec
Fronz-Tec - avatar
0
crap, so I can't edit the width AND change the color?
24th Oct 2016, 4:10 PM
Thomas Campbell
Thomas Campbell - avatar
0
you can edit four basic HTML attributes of <hr> and many more in CSS see my code example https://code.sololearn.com/W0FC9y2b9aei Anyway those attributes are not supported in HTML5.
3rd Nov 2016, 4:21 PM
Mojmír Volf
Mojmír Volf - avatar
0
You would need ; semicolons to seperate the different attributes
26th Nov 2016, 4:00 PM
Bailey
- 1
I found another way, using strictly HTML codes. I'm not that experienced with CSS just yet. This is only my second year coding so.. here's another way: <HR COLOR="#00FF00" WIDTH="150PX"/>
25th Oct 2016, 8:45 PM
Thomas Campbell
Thomas Campbell - avatar