Development n00b question

Discussion in 'Software' started by Phire, 15 Apr 2002.

  1. Phire

    Phire Performance-PCs.com

    Joined:
    11 Jan 2002
    Posts:
    1,441
    Likes Received:
    0
    what exactly does the <pre> tag do?
    I want to indent some text, I already specified the class for the <div> but I cant remember how to indent......I know the tag, just cant remember it!


    :rolleyes:
     
    Last edited: 15 Apr 2002
  2. pszaro

    pszaro What's a Dremel?

    Joined:
    11 Mar 2002
    Posts:
    206
    Likes Received:
    0
    The HTML tag <PRE>Some text</PRE> is often used to keep the formating of text that uses tabs and spaces to create white space. Generally HTML strips out any extra spaces and tabs.

    The main problem with using the <PRE></PRE> tags is that you become dependant on how each viewer has configured their browser. The <PRE></PRE> tags need monospaced fonts (each character is the same width like "i" and "m" and "." and "space") to display properly. Fonts such as Courier (or Monaco on the Mac) are monospaced.

    As an example, Netscape's preferences allow you to pick the proportional font and the fixed (or monospaced) font. I'm currently using Times (proportional) and Monaco (fixed).

    You can never be sure that a viewer has chosen a fixed or monospaced font for the "fixed font."

    No real way around this with the <PRE></PRE> tag - without asking the viewer to adjust their browser to match your suggested configuration.

    [ http://www.techbabes.com/WebTech/HTML/tipsPre.html ]
     
  3. linear

    linear Minimodder

    Joined:
    5 Oct 2001
    Posts:
    4,393
    Likes Received:
    1
    I would tend to recommend

    Code:
    .indented {
      text-indent	: 20px;
    } 
    or if you would rather indent by default (like on my site)

    Code:
    P {
      text-indent	: 20px;
      text-align : justify;
      line-height	: 16px;
      margin-top	: 10px;
    }
    
    P.noindent {
      text-indent	: 0px;
      text-align : left;
    } 
     

Share This Page