SitePoint Sponsor |
|
User Tag List
Results 1 to 4 of 4
Thread: Dashed underline in css
-
Mar 9, 2004, 13:20 #1
Dashed underline in css
Hi I am trying to underline an <h1> using css. I have been using the border property to do this, however this underlines the full <h1>, I would like the underline to finish where the text ends, can anyone help?
DH
-
Mar 9, 2004, 13:38 #2
There are different ways to go about this, if you want to only underline the text of the <h1>. Take a look at the following markup/CSS combos and see which one works best for you:
Option #1:
Code:h1 { display: inline; border-bottom: 1px dashed red; } ---------- <h1>My heading</h1> <!--this break is here because <h1> isn't block anymore--> <br />
Code:h1 span { border-bottom: 1px dashed red; } --------------------- <h1><span>My heading</span></h1>
-
Mar 9, 2004, 13:50 #3
thanks vinnie,
I used the second, seemed less buggy.
DH
-
Mar 9, 2004, 14:18 #4
- Join Date
- Oct 2003
- Location
- Island of Puerto Rico @ the Caribbean
- Posts
- 873
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Nice tip!
James: Ecodig - My Blog - My Gallery
Validate your sites: CSS - HTML/XHTML
Without faith you are lost.
Bookmarks