Friday, March 26, 2010

pros and cons of using

Hi I was wondering if there were any real disadvantages of using %26lt;pre%26gt; as opposed to the other formatting tags which can appear complicated.

pros and cons of using

There shouldn't be any problems if you are using tags for their intended purposes.

pros and cons of using

Doesn't it depend on what you are trying to achieve? Using one tag instead of another just because you don't understand the others sounds as if you could get unintended results.

Thanks, it's not that I don't understand the tags, it's just that I was wondering why dreamweaver puts in all the different tags when using %26lt;pre%26gt; appears to be much more simple. I was thinking that it must be doing this for a good reason.

iandott wrote:

Thanks, it's not that I don't understand the tags, it's just that I was wondering why dreamweaver puts in all the different tags when using %26lt;pre%26gt; appears to be much more simple. I was thinking that it must be doing this for a good reason.

Thanks for your reply David, I do not think my understanding of web design is complete, thats why I asked the question.

Asking questions is what the forum is for. What's not clear about your original question is why you think %26lt;pre%26gt; is less complicated than using other HTML tags.

The basic idea of HTML is to mark up documents in a meaningful way. For example, %26lt;h1%26gt; for the main heading of the page, %26lt;h2%26gt; for subheadings, %26lt;p%26gt; for paragraphs and so on. Browsers ignore anything more than one space in HTML text, so the %26lt;pre%26gt; tag was added to make it easier to display small chunks of text that needed to preserve the extra spaces. It's not intended to be used to lay out pages.

In the early days of the Web, there weren't adequate tools to lay out pages, so different tags were pressed into service to do things they were never intended for. People started using %26lt;h5%26gt; tags for copyright notices because they displayed small, bold text. The %26lt;blockquote%26gt; tag was used to indent text; and to indent it further, %26lt;blockquote%26gt; tags were nested inside each other. Tables were used to create grids for layout, and so on.

Nowadays, there is excellent support in most browsers for CSS, so the trend is away from using all the old hacks for layout, and using CSS instead. If HTML were to be reinvented today, the %26lt;pre%26gt; tag would probably not exist. As I said before, you can use the white-space property in CSS to do the same, and probably more efficiently. However, it does exist, and it will remain part of HTML 5. The draft HTML 5 specification gives a handful of examples where %26lt;pre%26gt; might be used: http://dev.w3.org/html5/spec/Overview.html#the-pre-element. Take a look at that section (it's quite short). It should help explain why I found your original comments so puzzling.

In addition to David's links, have a look at Logical HTML tags

http://www.yourhtmlsource.com/accessibility/logicalstyle.html

Nancy O.
Alt-Web Design %26amp; Publishing
Web | Graphics | Print | Media?Specialists
www.alt-web.com/
www.twitter.com/altweb
www.alt-web.com/blogspot.com

Thanks for your reply. The reason I was asking was because I was copying text from a document and pasting it into the HTML, it seemed much esier to then put it inside %26lt;pre%26gt; tags.

If you are copying from a Word document, just paste the text directly into Design view. The default settings for paste preserve paragraphs and headings from Word documents. You can also use Paste Special, which lets you choose the type of formatting you want. See: http://help.adobe.com/en_US/Dreamweaver/10.0_Using/WSc78c5058ca073340dcda9110b1f 693f21-7ce9a.html.

The default paste preferences are described here: http://help.adobe.com/en_US/Dreamweaver/10.0_Using/WSc78c5058ca073340dcda9110b1f 693f21-7ce8a.html. Don't use Text With Structure Plus Full Formatting, because it fills your HTML with a lot of proprietary Microsoft rubbish.

Thanks for the links everyone. Last time I made a web page was using linux and editing with Quanta so I looks like I've got some real

catching up to do :-)

  • eye look
  • No comments:

    Post a Comment