![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
[use :before and :after] |

#3
| |||
| |||
|
|
Underlining makes people think it's a link. Be careful with this. Yep. It's for headings only. |
|
Toby's way may work. Another option is to set a width in ems for that specific heading which works. That would mean to set the width for each individual heading? In most |
#4
| |||
| |||
|
|
Hi! I'm trying to use a different underline color than the text color on my headings using the border-bottom method. |
|
Unfortunately the underline spans the whole width of the heading (not only the text), because headings are block elements. |
|
Is there another way than using extra-markup like div class="h1"><span>My heading</span></div to get an underline which only underlines the text? |
#5
| |||
| |||
|
|
div class="h1"><span>My heading</span></div |
#6
| |||
| |||
|
|
div class="h1"><span>My heading</span></div Do you apply the underline to h1? Then try to apply it to the span: h1 span { border-bottom:1px solid red; } |
When using the above markup, it's no
#7
| |||
| |||
|
|
div class="h1"><span>My heading</span></div Do you apply the underline to h1? Then try to apply it to the span: h1 span { border-bottom:1px solid red; } No, that's not the problem When using the above markup, it's noproblem to get the desired effect. My question was if this could be done *without* extra markup, i.e. "<h1>My heading</h1>". This seems to be possible, according to the other answers I got. |
![]() |
| Thread Tools | |
| Display Modes | |
| |