Results 1 to 14 of 14

Thread: Spaces in HTML

  1. #1
    Advanced Member
    Join Date
    Nov 2000
    Location
    Davie, FL
    Posts
    536

    Spaces in HTML

    I am doing a large line of text, alternating colors, red/geen with the words HAPPY HOLIDAYS. I have a space between each letter, no problem. But I want to insert additional spaces between the 2 words and cant. When I add multiple spaces in my HTML code, I still get just one space.

    HELP!!!

  2. #2
    ♫♪ ♫♪ ♫♪ ♫♪ downhill's Avatar
    Join Date
    Jan 2000
    Location
    My Own Private Idaho
    Posts
    34,714
    Dunno if this is the correct way but I'm sure it works. Use......

    Code:
     
    for each space between the words.

  3. #3
    Advanced Member
    Join Date
    Nov 2000
    Location
    Davie, FL
    Posts
    536
    Worked, Thanks!

  4. #4
    ♫♪ ♫♪ ♫♪ ♫♪ downhill's Avatar
    Join Date
    Jan 2000
    Location
    My Own Private Idaho
    Posts
    34,714
    Quote Originally Posted by Qui-Gon John View Post
    Worked, Thanks!

  5. #5
    Forum Techie Amro's Avatar
    Join Date
    Jan 2000
    Location
    Atlanta
    Posts
    10,695
    Quote Originally Posted by downhill View Post
    Dunno if this is the correct way but I'm sure it works. Use......

    Code:
     
    for each space between the words.
    Absolutely correct. Browsers strip most white space or it'd be really painful to hand code the stuff.
    amro.co, github.com/amro

  6. #6
    Advanced Member
    Join Date
    Nov 2000
    Location
    Davie, FL
    Posts
    536
    The funny thing is, I did a <font color> then </font> for each letter and in between each group of commands, I included a space, which it did take. But not the several spaces between words, until I used the nbsp command.

  7. #7
    Forum Techie Amro's Avatar
    Join Date
    Jan 2000
    Location
    Atlanta
    Posts
    10,695
    Quote Originally Posted by Qui-Gon John View Post
    The funny thing is, I did a <font color> then </font> for each letter and in between each group of commands, I included a space, which it did take. But not the several spaces between words, until I used the nbsp command.
    Right, if it didn't condense to 1 space, you'd have to put &nbsp; between every word, that would also be a pain.
    amro.co, github.com/amro

  8. #8
    Elite Member TonyT's Avatar
    Join Date
    Jan 2000
    Location
    Fairfax, VA
    Posts
    10,073
    With HTML you can have ONE space between letters or words using the spacebar key, additional spacebar keyings will have no effect, HTML will condense back to one space. Use the non-breaking space HTML entity &nbsp;.

    You can also use CSS to control space between letters and words in pixel amounts, example:
    Code:
    <p style="font:Arial; font-size:larger; letter-spacing 10px;">This is some text.</p>
    Code:
    <p style="font:Arial; font-size:larger; word-spacing 20px;">This is some text.</p>
    No one has any right to force data on you
    and command you to believe it or else.
    If it is not true for you, it isn't true.

    LRH

  9. #9
    SG Family ghettoside's Avatar
    Join Date
    Mar 2003
    Location
    At Large in the US
    Posts
    5,154
    Quote Originally Posted by TonyT View Post
    With HTML you can have ONE space between letters or words using the spacebar key, additional spacebar keyings will have no effect, HTML will condense back to one space. Use the non-breaking space HTML entity &nbsp;.

    You can also use CSS to control space between letters and words in pixel amounts, example:
    Code:
    <p style="font:Arial; font-size:larger; letter-spacing 10px;">This is some text.</p>
    Code:
    <p style="font:Arial; font-size:larger; word-spacing 20px;">This is some text.</p>
    lol, you beat me to it Tony.
    Quote Originally Posted by Norm View Post

    There are idiots everywhere.

    At work, in forums, in poetry classes, everywhere!


    WebSites-n-Services.com

    Internet Security Guide & Downloads

  10. #10
    Junior Member
    Join Date
    Aug 2008
    Posts
    1
    Hello........friends
    HTML space use this coding

    &nbsp;
    Thank you
    http://www.css-faq.com/

  11. #11
    no. no, No. NO, NO... NO! stevebakh's Avatar
    Join Date
    Aug 2002
    Location
    Manchester, UK
    Posts
    3,247
    Quote Originally Posted by Pitter View Post
    Hello........friends
    HTML space use this coding

    &nbsp;
    Thank you
    Spam much?

  12. #12
    Forum Techie Amro's Avatar
    Join Date
    Jan 2000
    Location
    Atlanta
    Posts
    10,695
    http://www.w3schools.com is better, for future visitors
    amro.co, github.com/amro

  13. #13
    no. no, No. NO, NO... NO! stevebakh's Avatar
    Join Date
    Aug 2002
    Location
    Manchester, UK
    Posts
    3,247
    Tony's answer was the correct one. Nobody should ever use space characters to seperate individual letters in HTML. It's a styling issue and should be done via CSS using the letter-spacing property.

  14. #14
    Junior Member
    Join Date
    Feb 2013
    Posts
    1
    Quote Originally Posted by Amro View Post
    http://www.w3schools.com is better, for future visitors
    You can learn more about html special characters here http://www.corelangs.com/html/tags/s...haracters.html hope it will help you in future

    throt.
    www.corelangs.com

Similar Threads

  1. hide html code on my website
    By daabomb2002 in forum Programming Forum
    Replies: 2
    Last Post: 04-18-07, 03:05 PM
  2. Help.....PSD, CSS & HTML Dilema
    By reznog12 in forum Programming Forum
    Replies: 1
    Last Post: 04-18-06, 11:35 AM
  3. HTML, click image to email... How?
    By EvilAngel in forum General Discussion Board
    Replies: 9
    Last Post: 06-12-05, 03:13 PM
  4. html
    By Rivas in forum Programming Forum
    Replies: 2
    Last Post: 05-05-05, 01:05 PM
  5. HTML If statement
    By Kyle in forum Programming Forum
    Replies: 2
    Last Post: 01-12-05, 03:18 PM

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
  •