Web Design |
topic title |
||
main menushelp pagesprinter-friendly/text-only version your accountUse your ACOM account to access the discussion boards, submit course work and check marks and feedback Essential related topicsRelated topics |
The <P> tag
<P> stands for paragraph, and it is the most ubiquitous of the text formatting tags - possibly of all tags. If you view the source code of this page, or any of the pages on this or the sample site, you'll see that the tag starts most of the lines of text. For a clearer example, have a look at the following link, which is the same passage of text from The Law of Freedom as was given on this lesson's opening page. This time it has been correctly formatted, using <P> tags rather than expecting the line breaks and spaces in the plain text file to do the work. And, as before, you can try resizing the new window, to see how the browser is able to adjust the text accordingly. Or, try resizing the text, by the means also described on the opening page. Hopefully this'll all give you some idea of the potential fluidity of web page design. The <P> tag is a block-level tag. When it appears, it breaks the flow of text, in the same way as headings. In the actual HTML, it can take one, and only one attribute, this being ALIGN: see the page on alignment. However, as I hope is becoming clear, this should only be used in one-off cases where you want to override the general definition of <P> tags as defined in the style sheet. We have already done this in a basic way, defining the font family, size and the colour of paragraphs. For now we will leave the definition of <P> tags (and other text tags) at that: at the end of this first half of the course, on the page which lists all available style sheet properties, you can find out how to do several more things to your paragraphs. Finally, do note that <P> is one of those tags which sloppy web pages often fail to close. It is true that pages do usually work if you leave off the closing </P> tag, but the emphasis here is on the "usually". As with all other times you can be less rigorous with your HTML, what you'll also do is make your page less robust, and failure to close <P> tags may well cause the style formatting to fail. As ever - the advice is to be rigorous, and close your tags properly. |
Material on this site is © Drew Whitworth, 2005 Permission will usually be given to reproduce material from this site for non-commercial purposes, if credit is given. For enquiries, e-mail Drew at andrew [dot] whitworth [at] manchester [dot] ac [dot] uk.