SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    1-800-JMULDER JMulder's Avatar
    Join Date
    May 2001
    Location
    The Netherlands
    Posts
    1,745
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Capitalize Words

    Ok, I have a MySQL database that contains a table called Games (no it's not about PHP), the admin adds new games and enters the full name of a game, example: Shoot Bill's Shorts.

    On a page I am calling this name and print it, now I want to capitalize it. You ask "Why don't you capitalize it when you enter it?" ..because only one a couple of pages this name will be capitalized.

    So I found this piece of CSS code and also use it, no..I am afraid I cannot give you a page with the problem because it's secure.

    Code:
    <span style="text-transform: capitalize">Shoot Bill's Shorts</span>
    Tell me what's wrong, I never had to use this before Thanks in advance,
    Jeroen Mulder

    w: www.jeroenmulder.com

  2. #2
    Your Lord and Master, Foamy gold trophy Hierophant's Avatar
    Join Date
    Aug 1999
    Location
    Lancaster, Ca. USA
    Posts
    12,305
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Nothing is wrong with your CSS... It will transform your text to look like:

    Shoot Bill's Shorts
    The capitalize statement only capitalizes the first letter of each word. The code you are actually looking for is:

    Code:
    <span style="text-transform: uppercase">Shoot Bill's Shorts</span>
    Which will show the entire span in CAPITAL letters. I hope this helps.
    Wayne Luke
    ------------


  3. #3
    1-800-JMULDER JMulder's Avatar
    Join Date
    May 2001
    Location
    The Netherlands
    Posts
    1,745
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Aaah Of course!

    I have an excuse, english isn't my native language

    Thanks Wayne,

    *does a little dance*
    Jeroen Mulder

    w: www.jeroenmulder.com

  4. #4
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Why not just use PHP to convert the thing to upper case when you output it? That way you don't have to depend on sketchy support for the text-transform: uppercase attribute:
    http://www.richinstyle.com/bugs/table.html


    http://www.php.net/manual/en/function.strtoupper.php
    $str = "Shoot Bill's Shorts ";
    $str = strtoupper($str);
    print $str; # Prints SHOOT BILL'S SHORTS
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  5. #5
    1-800-JMULDER JMulder's Avatar
    Join Date
    May 2001
    Location
    The Netherlands
    Posts
    1,745
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ah yeah, thanks creole I didn't think of PHP at all, CSS seemed most obvious..
    Jeroen Mulder

    w: www.jeroenmulder.com


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
  •