Creating a dashed line

Discussion in 'HTML' started by John Abbler, Jul 13, 2005.

  1. John Abbler

    John Abbler Guest

    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!
     
    John Abbler, Jul 13, 2005
    #1
    1. Advertising

  2. 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
     
    Roy Schestowitz, Jul 13, 2005
    #2
    1. Advertising

  3. John Abbler

    John Abbler Guest

    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
     
    John Abbler, Jul 13, 2005
    #3
  4. Re: CSS dashed line

    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
     
    Roy Schestowitz, Jul 13, 2005
    #4
  5. 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.
     
    Beauregard T. Shagnasty, Jul 13, 2005
    #5
  6. John Abbler

    JDS Guest

    Re: CSS dashed line

    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/
     
    JDS, Jul 13, 2005
    #6
  7. John Abbler

    dorayme Guest

    Re: CSS dashed line

    > 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
     
    dorayme, Jul 14, 2005
    #7
  8. 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
     
    Jonathan N. Little, Jul 14, 2005
    #8
  9. Jonathan N. Little wrote:
    > but on the MS side requires 5.5+


    Anyone still running less deserves all that they get! :-D

    > 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.
     
    Beauregard T. Shagnasty, Jul 14, 2005
    #9
  10. Re: CSS dashed line

    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
    fuckwit comment and tear other people's suggestions apart. I think
    Beauregard was quite polite though.

    Roy

    --
    Roy S. Schestowitz
    http://Schestowitz.com
     
    Roy Schestowitz, Jul 14, 2005
    #10
  11. Re: CSS dashed line

    Roy Schestowitz wrote:
    > 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 fuckwit comment and tear other people's suggestions
    > apart. I think Beauregard was quite polite though.


    Whew!

    Glad I'm not a Mr. Know-all... :-D

    --
    -bts
    -This space intentionally left blank.
     
    Beauregard T. Shagnasty, Jul 14, 2005
    #11
  12. Beauregard T. Shagnasty wrote:
    > Jonathan N. Little wrote:
    >
    >> but on the MS side requires 5.5+

    >
    >
    > Anyone still running less deserves all that they get! :-D
    >
    >> 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>
    >


    I just got a order recently at my site and my debug info revealed the
    client was running W2K and NN4.79! And I still get enough visitors with
    WebTV that I struggle to tweak the site at least allow basic
    navigation and reasonably aesthetic experience with that POS!

    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
     
    Jonathan N. Little, Jul 14, 2005
    #12
  13. John Abbler

    dorayme Guest

    Re: CSS dashed line

    > From: Roy Schestowitz <>
    >
    > I sometimes feel reluctant to suggest something that's not perfect...
    >


    Yes, I bet many have felt this way, there is always a tension between
    offering advice that will short-term help someone fix a present problem in
    terms that are easily understood and giving more long-term advice. The
    latter is often more time consuming. I reckon what kchayka said once is not
    too bad: "remember to wear your flame-retardant teflon suit when you come
    here"

    dorayme
     
    dorayme, Jul 14, 2005
    #13
  14. John Abbler

    dorayme Guest

    Re: CSS dashed line

    > From: "Beauregard T. Shagnasty" <>
    >
    > Roy Schestowitz wrote:
    >> ... A Mr. Know-all would come out
    >> with some fuckwit comment and tear other people's suggestions
    >> apart. I think Beauregard was quite polite though.

    >
    > Whew!
    >
    > Glad I'm not a Mr. Know-all... :-D
    >


    Just hold it right there! You may be a polite one. Still, cheer up again, it
    is the best kind.

    dorayme
     
    dorayme, Jul 14, 2005
    #14
  15. John Abbler

    JDS Guest

    Re: CSS dashed line

    On Thu, 14 Jul 2005 04:00:39 +0100, Roy Schestowitz wrote:

    > 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
    > fuckwit comment and tear other people's suggestions apart. I think
    > Beauregard was quite polite though.
    >
    > Roy


    Roy, your suggestion is not just "not perfect" but has actualy valid
    reasons for not being a Good Idea(TM).

    Don't feel reluctant for suggesting something that's not perfect. Your
    suggestion would work, right? I was just pointing out reasons why I
    thought it didn't seem like such a good idea.

    As for polite, **** polite. This is Usenet. I wasn't particularly
    IMpolite, though, was I? In fact, I actually thought I was on the cusp of
    politeness, mitigated by straightforwardness that resulted in the
    appearance of impoliteness.

    At least that's my take on it.

    I still say your idea of using <H6> sucks.

    --
    JDS | lid
    | http://www.newtnotes.com
    DJMBS | http://newtnotes.com/doctor-jeff-master-brainsurgeon/
     
    JDS, Jul 15, 2005
    #15
  16. John Abbler

    dorayme Guest

    Re: CSS dashed line

    > From: JDS <>
    > I still say your idea of using <H6> sucks.


    Say what you like. When I become king you will damn well use <h6> wherever
    it will work instead of any other more goody goody correct markup. Things
    are going to be very different, trust me... And by the way, there will be
    serious consequences for any derogatory remarks about the misuse of <h6>.
    <h6> will be compulsory. Get used to the idea. Now.

    dorayme
     
    dorayme, Jul 15, 2005
    #16
  17. Re: Dashed Line using Header

    JDS wrote:

    > On Thu, 14 Jul 2005 04:00:39 +0100, Roy Schestowitz wrote:
    >
    >> 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 fuckwit comment and tear other people's suggestions apart. I think
    >> Beauregard was quite polite though.
    >>
    >> Roy

    >
    > Roy, your suggestion is not just "not perfect" but has actualy valid
    > reasons for not being a Good Idea(TM).



    I know. Did I not admit that when I made the suggestion in the first place?


    > Don't feel reluctant for suggesting something that's not perfect. Your
    > suggestion would work, right? I was just pointing out reasons why I
    > thought it didn't seem like such a good idea.
    >
    > As for polite, **** polite. This is Usenet. I wasn't particularly
    > IMpolite, though, was I? In fact, I actually thought I was on the cusp of
    > politeness, mitigated by straightforwardness that resulted in the
    > appearance of impoliteness.



    Wait, wait... what I said is that you were _polite_ (unlike several others).
    Check the thread again to see where the misunderstanding lies.


    > At least that's my take on it.
    >
    > I still say your idea of using <H6> sucks.



    I know! *smile* I never had it appear in public pages.

    Roy

    --
    Roy S. Schestowitz
    http://Schestowitz.com
     
    Roy Schestowitz, Jul 16, 2005
    #17
  18. John Abbler

    Neredbojias Guest

    Re: CSS dashed line

    With neither quill nor qualm, JDS quothed

    > As for polite, **** polite. This is Usenet. I wasn't particularly
    > IMpolite, though, was I? In fact, I actually thought I was on the cusp of
    > politeness, mitigated by straightforwardness that resulted in the
    > appearance of impoliteness.
    >
    > At least that's my take on it.
    >
    > I still say your idea of using <H6> sucks.


    He he, you were politely impolitic.

    --
    Neredbojias
    Contrary to popular belief, it is believable.
     
    Neredbojias, Jul 16, 2005
    #18
  19. John Abbler

    JDS Guest

    JDS, Jul 18, 2005
    #19
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Rick
    Replies:
    3
    Views:
    1,482
    Sandip Chitale
    Sep 30, 2003
  2. Hugo
    Replies:
    10
    Views:
    1,387
    Matt Humphrey
    Oct 18, 2004
  3. TheKeith
    Replies:
    15
    Views:
    6,873
    Denise Enck
    Jun 30, 2003
  4. Hardeep Rakhra

    Help: How can I create a dashed HR

    Hardeep Rakhra, Jan 21, 2004, in forum: HTML
    Replies:
    8
    Views:
    37,606
    Spartanicus
    Jan 22, 2004
  5. Barkster

    Jpanel Dashed Border?

    Barkster, Jun 27, 2006, in forum: Java
    Replies:
    16
    Views:
    6,302
    Barkster
    Jul 3, 2006
Loading...

Share This Page