Removing dashes in links via CSS...possible?

Discussion in 'CSS' started by webwebby, May 26, 2011.

  1. #1
    Hi

    In css, is there some way through which I can remove dash (-) in links? For example, I have few links that are automatically displayed from site like below

    About-us
    Contact-us
    Our-server ices

    What I want is to us a space ( ) instead of a dash that is automatically added due to URL rewrite.

    Please help

    Regards
     
    webwebby, May 26, 2011 IP
  2. TSelbeck

    TSelbeck Peon

    Messages:
    26
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Hi webwebby, as far as I'm aware, there is no option to replace dashes with CSS. There is a 'content' element in CSS, which would allow i.e. content: 'About us';... but I think that's about it

    Easiest way would be with jQuery, or a server side language such as PHP

    
    <?
    echo str_replace("-", " ", "About-us");
    ?>
    
    PHP:
     
    TSelbeck, May 27, 2011 IP
  3. ApocalypseXL

    ApocalypseXL Notable Member

    Messages:
    6,095
    Likes Received:
    103
    Best Answers:
    5
    Trophy Points:
    240
    #3
    jQuery would be the way to go in this case . PHP is a bit of a overkill for most people .
     
    ApocalypseXL, May 28, 2011 IP
  4. pixelmarkup

    pixelmarkup Peon

    Messages:
    16
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    haha well said ApocalypseXL.. I'd go for jQuery as well on this one.
     
    pixelmarkup, May 30, 2011 IP
  5. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #5
    I would handle that *** server side as doing so client-side isn't just a waste of code (though I say that about every time some {expletive deleted} suggests Jquery as the solution to a problem) that fat bloated steaming pile of dung library doesn't work if scripting is disabled -- and frankly that's content output, generated content output should be handled server-side. That fat bloated idiocy has flushed more perfectly good websites down the toilet than I care to count. **** Jquery.

    Though your wording leaves me asking questions -- do you want to change it in the CONTENT of the anchor, or are you trying to change the URL? You're saying URL-rewrite so I'm assuming you're not talking the text inside the link, but the href itself!!! That would PROBABLY break the site.

    If you are using the same value for both in the skin, that's instant /FAIL/....

    But every response here is guessing wildly since you provided no example output code or the code that generates it. Without that we're all throwing darts at a board blindfolded in the dark.
     
    deathshadow, Jun 4, 2011 IP
  6. ApocalypseXL

    ApocalypseXL Notable Member

    Messages:
    6,095
    Likes Received:
    103
    Best Answers:
    5
    Trophy Points:
    240
    #6
    Be freaking serious , how many people walk around with JavaScript disabled ? Most people don't even know what Java is .
     
    ApocalypseXL, Jun 4, 2011 IP
  7. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #7
    Oh I don't know, the 86 million or so people who've downloaded the for starters? Or per page enabling in Opera? How about the people on mobile still using netfront? Blazer?

    Yeah, some people don't even know that Java and Javascript are two completely unrelated and separately developed languages that unfortunately happen to share the same root word all because of a back-room deal Sun made with Netscape back in '95... They'll use the two terms interchangeably like they actually have anything to do with each-other. :rolleyes:
     
    deathshadow, Jun 4, 2011 IP
  8. ApocalypseXL

    ApocalypseXL Notable Member

    Messages:
    6,095
    Likes Received:
    103
    Best Answers:
    5
    Trophy Points:
    240
    #8


    #1 Your link ain't working

    #2 Even if you are right and you have @80 million people walking around with no Mocha (happy now ?) that is still under 3% of the current
    Internet population , the kind of people that you file under insignificant section .


    Wow !!! Really ?!?! I thought JavaScript was a dialect of Javanese :rolleyes:
     
    ApocalypseXL, Jun 5, 2011 IP
  9. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #9
    So are Opera users percent-wise if stats are to be believed -- do you tell them to shtup off? I'm sorry but the "oh it's only x%" nonsense reeks of being a Lame excuse for not being a web professional. (see the "target audience" section)

    I mean, you folks are basically talking about adding 26k of (compressed) javascript, with some extra script added on top of that, to change a handful of characters incorrectly output by the server? That's just nonsense... With that type of idiocy is it any wonder the web is polluted with megabyte sized train-wrecks of bounce-land failures? (like vBull 4 which must be bringing the hosting for this site to it's knees two or three times a day and costing four or five times as much to host as neccessary)
     
    Last edited: Jun 5, 2011
    deathshadow, Jun 5, 2011 IP
  10. TSelbeck

    TSelbeck Peon

    Messages:
    26
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #10
    I laughed when I initially read this the day you replied to to the topic - wasn't even going to entertain a debate with your idiotic statement. However, you seem to be still favouring jQuery despite the disadvantages that deathshadow has given.

    There are just over 2,000,000,000 that use the internet. The jQuery method would mean the 3% (around 60,000,000 users, around the population of the UK) could not correctly operate the site.

    PHP - the entire 2,000,000,000 would successfully be able to be able to operate the site. It would also load quicker and download less (less users bandwidth, less server resources, less server bandwidth.. etc)

    It makes no sense to favour jQuery over PHP unless for some reason - you were unable to use an SSI. I merely offered the suggestion to offer alternatives to the OP - but no way would I suggest using jQuery over PHP.
     
    TSelbeck, Jun 5, 2011 IP
  11. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #11
    While I wouldn't suggest using that fat bloated pile of manure that's flushing the ENTIRE Internet down the crapper for ANYTHING in the first place.

    Unless you think there's nothing wrong with these megabyte sized monstrosities built with hundreds of separate files all to deliver single digit K of content.
     
    deathshadow, Jun 6, 2011 IP
  12. drhowarddrfine

    drhowarddrfine Peon

    Messages:
    5,428
    Likes Received:
    95
    Best Answers:
    7
    Trophy Points:
    0
    #12
    1) jQuery is only about 230K, not megabytes.
    2) I agree using jQuery, or any javascript, to fix a CSS problem is stupid at best.
    3) The number of people who run with javascript turned off is well known to be about 2%. But that 2% knows what they're getting themselves into by doing so, turning off functionality in many cases, and they obviously know how to turn it back on if they need it. If I needed to use javascript for functionality, not pretty displays, I would have no issue using it.
     
    drhowarddrfine, Jun 6, 2011 IP
  13. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #13
    By itself compressed it's more like 26k -- but by the time most people get done using it, the garbage cryptic bloated scripts for NOTHING written using it, fat bloated CSS frameworks, and "but I can do it in photoshop" accessibility train wreck websites, a great many websites end up pushing a megabyte or more.

    When I consider anything more than 70k for the average page to be a bloated disaster, with 140k as the upper acceptable limit.

    This doesn't even sound like a CSS problem though -- this isn't even javascript or CSS related -- it looks like a markup issue, so fix the bloody markup!
     
    deathshadow, Jun 6, 2011 IP
  14. unknownpray

    unknownpray Active Member

    Messages:
    3,831
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    70
    #14
    You can use this
    <?
    echo str_replace("-", " ", "About-us");
    ?>
     
    unknownpray, Jul 15, 2011 IP