SitePoint Sponsor

User Tag List

Results 1 to 13 of 13
  1. #1
    SitePoint Evangelist silversurfer5150's Avatar
    Join Date
    Aug 2010
    Posts
    534
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question preformatted text

    Hey guys,

    I'm having a few problems with preformatted text in that it is not behaving as you would expect it to. For example, if it is laid out as below it is fine:

    <pre>
    This is preformatted text
    It works just fine
    </pre>


    However, when I need it to appear further indented into the page as below, it looks messed up and I have to do this to correct:

    <pre>
    This is preformatted text
    It works not so good!
    </pre>

    A really silly problem that has cost me far to much time Can anyone help?

    thanks

    Will

  2. #2
    SitePoint Evangelist captainccs's Avatar
    Join Date
    Mar 2004
    Location
    Caracas, Venezuela
    Posts
    516
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    How are the examples you posted different? They look the same to me.


    Code HTML4Strict:
    <pre>
    This is preformatted text
    It works just fine
    </pre>

    Code HTML4Strict:
    <pre>
       This is preformatted text
       It works just fine
    </pre>
    Denny Schlesinger
    web services

  3. #3
    Resident curmudgeon bronze trophy gary.turner's Avatar
    Join Date
    Jan 2009
    Location
    Dallas
    Posts
    990
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    <pre> is a block element. Simply give it a left margin.

    cheers,

    gary
    Anyone can build a usable website. It takes a graphic
    designer to make it slow, confusing, and painful to use.

    Simple minded html & css demos and tutorials

  4. #4
    SitePoint Evangelist silversurfer5150's Avatar
    Join Date
    Aug 2010
    Posts
    534
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks very much Gary, that makes a lot of sense.

  5. #5
    SitePoint Evangelist silversurfer5150's Avatar
    Join Date
    Aug 2010
    Posts
    534
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question

    Hey I definitely don't know whats going on here so heres the link anyway guys, the pre element is styled with text-align:left to override a previous style rule and the font has been changed to arial:

    http://www.cbl.com/newsite/contact/details.html

    Also when I try to make some of these words bold even stranger things occur

  6. #6
    Robert Wellock silver trophybronze trophy xhtmlcoder's Avatar
    Join Date
    Apr 2002
    Location
    A Maze of Twisty Little Passages
    Posts
    6,316
    Mentioned
    60 Post(s)
    Tagged
    0 Thread(s)
    Why are you using the PRE for 'Company Directors', it doesn't make much sense especially since you aren't using a fixed width font.

  7. #7
    SitePoint Evangelist captainccs's Avatar
    Join Date
    Mar 2004
    Location
    Caracas, Venezuela
    Posts
    516
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by silversurfer5150 View Post
    Hey I definitely don't know whats going on here so heres the link anyway guys, the pre element is styled with text-align:left to override a previous style rule and the font has been changed to arial:

    http://www.cbl.com/newsite/contact/details.html

    Also when I try to make some of these words bold even stranger things occur
    pre spacing only works with fixed width fonts!
    Denny Schlesinger
    web services

  8. #8
    SitePoint Evangelist silversurfer5150's Avatar
    Join Date
    Aug 2010
    Posts
    534
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey,
    Thanks guys I wasn't aware of the monospaced fonts but it still doesnt work and I have just figured out why.

    Dreamweaver is not indenting the lines with the same number of spaces that a regular notepad text editor does. It is some evil little setting on dreamweaver which is causing the text to look messed up. Here is a test I just did:

    www.pembrokechiro.co.uk/test.htm

    On CS4 that appeared correctly lined up and indented!


    Does anyone know what is happening? Is there some auto-indent property that I can switch off?

  9. #9
    SitePoint Evangelist captainccs's Avatar
    Join Date
    Mar 2004
    Location
    Caracas, Venezuela
    Posts
    516
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    The text is not properly spaced in the original!
    Denny Schlesinger
    web services

  10. #10
    Robert Wellock silver trophybronze trophy xhtmlcoder's Avatar
    Join Date
    Apr 2002
    Location
    A Maze of Twisty Little Passages
    Posts
    6,316
    Mentioned
    60 Post(s)
    Tagged
    0 Thread(s)
    I'd suspect one of them is actually using TAB spaces by the looks of things.

  11. #11
    SitePoint Evangelist silversurfer5150's Avatar
    Join Date
    Aug 2010
    Posts
    534
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey thanks everyone for your input, I am aware that the source and the result are the same, I am past that problem, what I am asking is if anyone knows if there is a setting in Dreamweaver CS4 which makes it space out elements just as ay other notepad editor would,
    thankyou

  12. #12
    Robert Wellock silver trophybronze trophy xhtmlcoder's Avatar
    Join Date
    Apr 2002
    Location
    A Maze of Twisty Little Passages
    Posts
    6,316
    Mentioned
    60 Post(s)
    Tagged
    0 Thread(s)
    I'd assume there is a code format setting within DW by selecting Edit> Preferences. In the Preferences dialogue box, select the Code Format category. Then get fiddling with the values as appropriate.

    However, if you have 'copied and pasted' those characters you might need to do a Find and Replace of any tab characters already inserted to remove them.

  13. #13
    SitePoint Evangelist silversurfer5150's Avatar
    Join Date
    Aug 2010
    Posts
    534
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey thanks very much for you input everyone,
    A simple problem but no I have a handle on it


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
  •