www.webdeveloper.com
Results 1 to 3 of 3

Thread: PRE and P tags

  1. #1
    Join Date
    Sep 2008
    Posts
    2

    PRE and P tags

    I know i can't use them together but i need toI. have 2-3 pages of text and need to add it to my website.This text has many paragraphs.What i need is to have justified text so i use the "p" tag with text-align set to "justify" but also i want to use the "pre" tag for the blank lines between the paragraphs.Otherwise there are no blank lines.Ofcourse i can't use the "pre" and "p" tag together,so what's the alternative?The implementors of HTML are genius...seriously...

  2. #2
    Join Date
    Jan 2007
    Location
    Wisconsin
    Posts
    2,120
    Well, in a sense, you can nest any tag in any other open tag you want to--it's just a question of how it renders. But, what I think you want is something like this:
    HTML Code:
    <p style='text-align: left;'>some words ... some more words
    <br /><br />this is a new paragraph ... 
    </p>
    Or something like this:
    HTML Code:
    <p style='text-align: left;'>some words ... some more words</p>
    <p style='text-align: left;'>this is a new paragraph ... </p>
    Does that help?

  3. #3
    Join Date
    Jan 2005
    Location
    Frankfort, KY, USA
    Posts
    6,167
    Or you could use CSS to control your spacing without all the HTML tags:
    Code:
    <style type="text/css">
    p {margin-bottom: 1em;}
    </style>

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