SitePoint Sponsor

User Tag List

Results 1 to 11 of 11
  1. #1
    SitePoint Member
    Join Date
    Aug 2007
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Leaders between words using CSS

    How can I put "......." between items, using CSS - NOT CSS3?

  2. #2
    I meant that to happen silver trophybronze trophy Raffles's Avatar
    Join Date
    Sep 2005
    Location
    Tanzania
    Posts
    4,662
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    You can't, not without CSS3. Even with CSS3, you'd have to put each item you want "......" to appear after in an element of some sort, you couldn't just put that after raw text words.

    What you want in this case is Javascript.

  3. #3
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's possible to simulate leaders using a 1px dotted bottom border for the containing element, enclosing the text parts in some element (like a SPAN) and giving them a background colour and relative positioning, then nudging them down a pixel or two.

    It can be difficult in IE, since it renders 1px dotted borders as dashed, though.
    Birnam wood is come to Dunsinane

  4. #4
    I meant that to happen silver trophybronze trophy Raffles's Avatar
    Join Date
    Sep 2005
    Location
    Tanzania
    Posts
    4,662
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Good idea. 2px render as dots though, if that's not too thick for you, grandma. Still, I think using javascript would be less messy than enclosing each word in a SPAN.

  5. #5
    SitePoint Member
    Join Date
    Aug 2007
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    CSS Leaders

    Putting each word in a SPAN seems like way too much work.

    The problem with writing in Javascript is that not everybody I am publishing to (an Intranet application) has Java installed. I had a password in Javascript and had to change it because some people could not access it.

  6. #6
    I meant that to happen silver trophybronze trophy Raffles's Avatar
    Join Date
    Sep 2005
    Location
    Tanzania
    Posts
    4,662
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Sounds like you're confusing Javascript and Java which are two completely different things. All common web browsers have Javascript (though a very small number of people turn it off, and some intranets turn it off). Passwords are more likely to be related to Java than Javascript, and for this you need Javascript, not Java.

  7. #7
    SitePoint Member
    Join Date
    Aug 2007
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Leaders

    Which is it that Microsoft used to bundle with Windows, but then stopped?

  8. #8
    I meant that to happen silver trophybronze trophy Raffles's Avatar
    Join Date
    Sep 2005
    Location
    Tanzania
    Posts
    4,662
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    SkiFree?

  9. #9
    In memoriam gold trophysilver trophybronze trophy Dan Schulz's Avatar
    Join Date
    May 2006
    Location
    Aurora, Illinois
    Posts
    15,478
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That would be Java. Java's a full-blown programming language that can be used online via little programs that can run in the browser called applets (programs written in Java can also be run as stand-alone applications). JavaScript is a scripting language written specifically for Web browsers.

    They're about as similar as night and day (only the names have anything in common with each other).

  10. #10
    padawan silver trophybronze trophy markbrown4's Avatar
    Join Date
    Jul 2006
    Location
    Victoria, Australia
    Posts
    4,107
    Mentioned
    28 Post(s)
    Tagged
    2 Thread(s)
    How can I put "......." between items, using CSS - NOT CSS3?
    Hi,

    I'm not exactly sure what you mean 'between items' as that could mean lots of different things.

    But if the items are all on one line you could do a similar thing to gmail, the dots can be a background image applied to the bottom right of the text line and you can cut of whatever characters hang outside the dimensions you set..

    I'll whip up an example..

    IE doesn't seem to like white-space: nowrap..
    http://www.yellowshoe.com.au/examples/grandma

  11. #11
    padawan silver trophybronze trophy markbrown4's Avatar
    Join Date
    Jul 2006
    Location
    Victoria, Australia
    Posts
    4,107
    Mentioned
    28 Post(s)
    Tagged
    2 Thread(s)
    It seems I had no idea what leaders were after all.. Some googling turned up this: http://home.tampabay.rr.com/bmerkey/...t-leaders.html


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
  •