www.webdeveloper.com
Results 1 to 4 of 4

Thread: pre tags conflicting with styles

  1. #1
    Join Date
    Jan 2006
    Posts
    102

    pre tags conflicting with styles

    I'm looking for a better way to format my form-to-database-and-back. I need the output to read my tabs and breaks, etc. I get my output by using a <pre> tag, but then I can't get it to conform to my styles, and it bleeds way off the page. wordwrap() is also giving me some funky tabs that push my text way off to the right. I'm rather hesitant to use bb code because I don't want my maintenance guys messing around with formatting more than they need to. Am I going to need to make the leap?

  2. #2
    Join Date
    Feb 2005
    Location
    Tauranga
    Posts
    2,062
    Try posting an example? or some formatting code? You can style your <pre> with CSS

  3. #3
    Join Date
    Jan 2006
    Posts
    102
    ahhh, duh. That should do it.

    cheers, mate.

  4. #4
    Join Date
    Jul 2005
    Location
    USA
    Posts
    912
    You can also CSS any element you want:

    #element{
    white-space: pre-wrap; /* css-3 */
    white-space: -moz-pre-wrap; /* Mozilla, since 1999 */
    white-space: -pre-wrap; /* Opera 4-6 */
    white-space: -o-pre-wrap; /* Opera 7 */
    word-wrap: break-word; /* Internet Explorer 5.5+ */
    white-space:pre;
    }
    Bitter web veteran

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles