Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New Coder
    Join Date
    Nov 2010
    Posts
    33
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Getting two words to stick on the same line

    How can I get 11 & battles to be on the same line without using a BR? I need a dynamic/flexible way of handling words like this.


    I was thinking of using invisible characters but I can't thin of any.
    ALT+255 just returns a space.

  • #2
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,675
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    Hello Keysle,
    Use a non-breaking space, like this 11 battles
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • Users who have thanked Excavator for this post:

    Keysle (05-27-2012)

  • #3
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,618
    Thanks
    0
    Thanked 645 Times in 635 Posts
    Or wrap it in a span like this:

    <span style="white-space:nowrap">11 battles</span>

    The non-breaking space is probably the better choice in this instance but it doesn't hurt to know the alternative.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • Users who have thanked felgall for this post:

    Keysle (05-27-2012)

  • #4
    New Coder
    Join Date
    Nov 2010
    Posts
    33
    Thanks
    12
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Excavator View Post
    Hello Keysle,
    Use a non-breaking space, like this 11&nbsp;battles
    Odd. I tried one of those and it failed.
    The no-wrap is good though. Thanks.


    I always wondered what that stood for.

  • #5
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,675
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    Quote Originally Posted by Keysle View Post
    Odd. I tried one of those and it failed.
    This makes me think something else is wrong. If you post your entire code, maybe we'd find what it is.
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • #6
    New Coder
    Join Date
    Apr 2012
    Posts
    67
    Thanks
    12
    Thanked 1 Time in 1 Post
    this would of been a stupid suggestion but if anything else didn't work eventhough i have seen it is working you could just make the text size 1 or 2 smaller


  •  

    Posting Permissions

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