SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Aug 2008
    Location
    Taiwan
    Posts
    59
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to create dotted outline on any element via Javascript?

    We know when a link is clicked the dotted oultine will appears around the link.

    Elements other than links can also have dotted outline by using CSS outline property. But this doesn't work in IE family who don't support outline property.

    Is there a way to create dotted outline on any element via Javascript?

  2. #2
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,578
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Set a border.

    Code:
    el.style.border = '1px dotted #ccc';

  3. #3
    SitePoint Enthusiast
    Join Date
    Aug 2008
    Location
    Taiwan
    Posts
    59
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Dan Grossman View Post
    Set a border.

    Code:
    el.style.border = '1px dotted #ccc';
    But IE incorrectly renders 1px dotted border as dashed border.


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •