Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Creating a dashed line

Reply
Thread Tools

Creating a dashed line

 
 
John Abbler
Guest
Posts: n/a
 
      07-13-2005
Does anyone know how to create a horizontal dashed line?

I would like something similar to a <hr>, except dashed, and I want to set
the color.

Thanks!


 
Reply With Quote
 
 
 
 
Roy Schestowitz
Guest
Posts: n/a
 
      07-13-2005
John Abbler wrote:

> Does anyone know how to create a horizontal dashed line?
>
> I would like something similar to a <hr>, except dashed, and I want to set
> the color.
>
> Thanks!


ELEMENT {
border-top: 3px dotted #000000;
margin-top: 5px;
}

Change ELEMENT to something currently unused; change colour and margin as it
suits you. Then embed the element in your document where you want to insert
a line.

Hope it helps,

Roy

--
Roy S. Schestowitz
http://Schestowitz.com
 
Reply With Quote
 
 
 
 
John Abbler
Guest
Posts: n/a
 
      07-13-2005
Hi Roy,

Thank you for the quick response!

I am trying to implement your suggestion, but must confess I don't know how
to embed the element in my document.

I added these lines to my stylesheet:

testelement {
border-top: 3px dotted #000000;
margin-top: 5px;
}

The I tried to add this to my document:
<testelement />

But, I'm not having luck yet. Am I implementing this correctly?

Thanks, again.

"Roy Schestowitz" <> wrote in message
news:db39q2$215e$...
> John Abbler wrote:
>
>> Does anyone know how to create a horizontal dashed line?
>>
>> I would like something similar to a <hr>, except dashed, and I want to
>> set
>> the color.
>>
>> Thanks!

>
> ELEMENT {
> border-top: 3px dotted #000000;
> margin-top: 5px;
> }
>
> Change ELEMENT to something currently unused; change colour and margin as
> it
> suits you. Then embed the element in your document where you want to
> insert
> a line.
>
> Hope it helps,
>
> Roy
>
> --
> Roy S. Schestowitz
> http://Schestowitz.com



 
Reply With Quote
 
Roy Schestowitz
Guest
Posts: n/a
 
      07-13-2005
John Abbler wrote:

> Hi Roy,
>
> Thank you for the quick response!
>
> I am trying to implement your suggestion, but must confess I don't know
> how to embed the element in my document.
>
> I added these lines to my stylesheet:
>
> testelement {
> border-top: 3px dotted #000000;
> margin-top: 5px;
> }
>
> The I tried to add this to my document:
> <testelement />
>
> But, I'm not having luck yet. Am I implementing this correctly?
>
> Thanks, again.


Try H6 assuming you do not use it in the document already. The rest of this
newsgroup will slag me off for suggesting something that is
semantically-rotten. In my defence, I implemented something similar only in
a password-protected Wiki which I use for correspondence.

Anyway, just add <h6> </h6> at the points where you want the horizontal
line. You are essentially rendering the top part of a rectagular box.

Roy

--
Roy S. Schestowitz
http://Schestowitz.com
 
Reply With Quote
 
Beauregard T. Shagnasty
Guest
Posts: n/a
 
      07-13-2005
John Abbler wrote:
> I added these lines to my stylesheet:
>
> testelement {
> border-top: 3px dotted #000000;
> margin-top: 5px;
> }


That's incorrect CSS.

> The I tried to add this to my document:
> <testelement />


You can't make up HTML elements.

Try this:

CSS:

..dashes {
border-top: 3px dashed #000000;
margin-top: 5px;
}

HTML:

<hr class='dashes'>

Alter to suit. Maybe even add a width in em or something.
width: 10em;

And please don't top-post.

--
-bts
-This space intentionally left blank.
 
Reply With Quote
 
JDS
Guest
Posts: n/a
 
      07-13-2005
On Wed, 13 Jul 2005 17:04:32 +0100, Roy Schestowitz wrote:

> Try H6 assuming you do not use it in the document already. The rest of this


Why? Seems a little bass-ackwards, and I'm not afraid to say it. Why not
just use a class and assign it to an HR (as suggested by someone else in
this thread)? That makes much more sense because

1) it will be more semantically correct -- <HR> is a horizontal line in
HTML

and

2) It will not cause problems later if, for some reason, you end up
actually *using* <h6> in your document

and

3) other reasons, I'm sure.

later...

--
JDS | lid
| http://www.newtnotes.com
DJMBS | http://newtnotes.com/doctor-jeff-master-brainsurgeon/

 
Reply With Quote
 
dorayme
Guest
Posts: n/a
 
      07-13-2005
> From: JDS <>
>
> On Wed, 13 Jul 2005 17:04:32 +0100, Roy Schestowitz wrote:
>
>> Try H6 assuming you do not use it in the document already. The rest of this

>
> Why? Seems a little bass-ackwards, and I'm not afraid to say it. Why not
> just use a class and assign it to an HR (as suggested by someone else in
> this thread)? That makes much more sense because


Well, hang on a bit... it was just a suggestion that would work quite well!
So someone made a possibly better one. Alright already, let us all keep
perfectly calm.

>
> 1) it will be more semantically correct -- <HR> is a horizontal line in
> HTML
>


In some moods I would prefer to use the politically incorrect <h6> and I'm
not afraid to say it...

> and
>
> 2) It will not cause problems later if, for some reason, you end up
> actually *using* <h6> in your document
>


Like that is likely...




dorayme


 
Reply With Quote
 
Jonathan N. Little
Guest
Posts: n/a
 
      07-14-2005
Beauregard T. Shagnasty wrote:
<snip>
>
> CSS:
>
> .dashes {
> border-top: 3px dashed #000000;
> margin-top: 5px;
> }

<snip>

Minor tweak:

..dashes {
border-top: 3px dashed #000000;
*border-bottom: 0;*
margin-top: 5px;
}

And a note:

Works on the Geckos: NN6+, Moz, FF.... but on the MS side requires 5.5+

Of course using the proper element, i.e. HR, means that it gracefully
degrades on non-compliant browsers. The line won't be dashed but it will
be a recognizable horizontal rule.


--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
 
Reply With Quote
 
Beauregard T. Shagnasty
Guest
Posts: n/a
 
      07-14-2005
Jonathan N. Little wrote:
> but on the MS side requires 5.5+


Anyone still running less deserves all that they get!

> Of course using the proper element, i.e. HR, means that it
> gracefully degrades on non-compliant browsers. The line won't be
> dashed but it will be a recognizable horizontal rule.


That's why I picked it... <g>

--
-bts
-This space intentionally left blank.
 
Reply With Quote
 
Roy Schestowitz
Guest
Posts: n/a
 
      07-14-2005
dorayme wrote:

>> From: JDS <>
>>
>> On Wed, 13 Jul 2005 17:04:32 +0100, Roy Schestowitz wrote:
>>
>>> Try H6 assuming you do not use it in the document already. The rest of
>>> this

>>
>> Why? Seems a little bass-ackwards, and I'm not afraid to say it. Why not
>> just use a class and assign it to an HR (as suggested by someone else in
>> this thread)? That makes much more sense because

>
> Well, hang on a bit... it was just a suggestion that would work quite
> well! So someone made a possibly better one. Alright already, let us all
> keep perfectly calm.
>
>>
>> 1) it will be more semantically correct -- <HR> is a horizontal line in
>> HTML
>>

>
> In some moods I would prefer to use the politically incorrect <h6> and I'm
> not afraid to say it...
>
>> and
>>
>> 2) It will not cause problems later if, for some reason, you end up
>> actually *using* <h6> in your document
>>

>
> Like that is likely...


Thanks for supporting my suggestion. I sometimes feel reluctant to suggest
something that's not perfect. A Mr. Know-all would come out with some
****wit comment and tear other people's suggestions apart. I think
Beauregard was quite polite though.

Roy

--
Roy S. Schestowitz
http://Schestowitz.com
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Jpanel Dashed Border? Barkster Java 16 07-03-2006 06:13 PM
Read a file line by line with a maximum number of characters per line Hugo Java 10 10-18-2004 11:42 AM
Help: How can I create a dashed HR Hardeep Rakhra HTML 8 01-22-2004 09:16 AM
how to draw a dashed line between two points Rick Java 3 09-30-2003 07:36 PM
annoying IE problem with dashed CSS borders TheKeith HTML 15 06-30-2003 07:17 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57