In html - keep phone number on same line without word wrapping at the hyphen

Posted on 2006-03-28
Last Modified: 2008-02-20
This is an annoyance; in my web pages, the text of a phone number at the end of a line will wrap at the hyphen, and I like to keep the phone number together. How do I keep the number together on the same line including the hyphens?
Question by:epaynedsm
    LVL 65

    Expert Comment

    can i see the page(s)? or can you post the code here?
    LVL 25

    Accepted Solution

    Have you tried the CSS nowrap property around the phone number?
    <span style="white-space:nowrap">1-800-555-100</span>

    Author Comment

    It happens on any page where the phone number will not fit at the end of a line, so it wraps automatically at the hyphen.

    Author Comment

    Ah... that is it, Rouchie. Thank you so much!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Javascript: Crash Course

    Javascript is not only emerging as the most important language to know, it's flexibility is unique. With Javascript being deployed on the web, mobile and even the desktop this is the one language that all technologists need to know.

    "I want to put my photos online, but I don't want them stolen.  What settings should I use?" When You Put Photos Online First and foremost, any digital file published on the WWW can be copied, stored, modified, retransmitted, etc.  Remember Naps…
    Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
    In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
    In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now