4 replies [Last post]
Jasmine
Offline
newbie
Last seen: 17 years 10 weeks ago
Joined: 2004-09-26
Posts: 4
Points: 0

Can someone give me the code for a dashed lines that will span accross my webpages. I don't need them for borders because thats not what I'm working with... this is what I need...

Arrow - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Thanks

roytheboy
roytheboy's picture
Offline
Guru
North Wales, UK
Last seen: 8 years 19 weeks ago
North Wales, UK
Timezone: GMT+1
Joined: 2004-09-18
Posts: 2233
Points: 41

Just need the code for a simple dashed line

One way to do this with CSS is to use the div border property. You don't have to set all four borders; just one e.g. border-bottom: 2px dashed #000000;. If you do not have any suitably positioned div's then you could try creating some with a non-breaking space inside to give the div some simple content with a small height (which you can change with 'line-height').

I also seem to remember reading somewhere that you can style an <hr> tag but I've never tried this myself.

One thing you need to accept from the start though, is that dotted and dashed lines are a bit hit-and-miss from browser to browser if you like pixel-perfect layouts!

Life's a b*tch and then you die!

Tony
Tony's picture
Offline
Moderator
Brisbane
Last seen: 1 day 3 hours ago
Brisbane
Timezone: GMT+10
Joined: 2003-03-12
Posts: 5344
Points: 2965

Just need the code for a simple dashed line

Hi Jasmine,
You could try using a hr.hr{ border:none; border-bottom: dashed 1px black; color:white;}

Hope that helps

Jasmine
Offline
newbie
Last seen: 17 years 10 weeks ago
Joined: 2004-09-26
Posts: 4
Points: 0

Just need the code for a simple dashed line

Roytheboy... Thanks... just figured out how to style the HR tag...

hr {
border-top: 1px dashed #999999;
color: #ffffff;
height: 1px;
}

In case you or anyone else is insterested...

Thanks again...

Jasmine
Offline
newbie
Last seen: 17 years 10 weeks ago
Joined: 2004-09-26
Posts: 4
Points: 0

Just need the code for a simple dashed line

Thanks Tony... I'll check it out...