Jump to content

Address Code For Html And Xhtml


marossity

Recommended Posts

This is the code in my test web page:

<p> Writing an address</p><address><b>Mr. Frederick Roberto Pazzimoni11/4 Olive Grove StreetPizzano BranchRoma, Italy00000</b></address>

In the html page it displays as shown, line for line.But in the xhtml page, it shows as one continuous line.From the w3Schools:

The <address> tag defines the contact information for the author or owner of a document. This way, the reader is able to contact the document's owner.
Differences Between HTML and XHTMLNONE
Same type of thing exists for me with respect to "blockquote".I am more than a bit confused. Do I have to use the preformatted code,<pre>?
Link to comment
Share on other sites

You don't ever need to use <pre>. You can use CSS instead. This would work:

address { white-space: pre; }

Blockquote never parses line breaks, I'm surprised to hear that <address> does, but I have rarely used it.

Link to comment
Share on other sites

Thanks for the response, Ingolme...But I wanted to know why the code is supposed to be the same in HTML and XHTML, but for me, it isn't.w3schools tutorial states they are the same, "Differences Between HTML and XHTML - NONE"Is there an error on their part, or am I goofing up again. :)With respect to blockquote...Here is the tutorial code:

<html><body>A blockquote quotation:<blockquote>This is a long quotation. This is a long quotation. This is a long quotation. This is a long quotation. This is a long quotation.</blockquote><p><b>The browser inserts line breaks and margins for a blockquote element.</b></p>A short quotation:<q>This is a short quotation</q><p><b>The q element does not render as anything special.</b></p></body></html>

and here is the resultant display:

A blockquote quotation: This is a long quotation. This is a long quotation. This is a long quotation. This is a long quotation. This is a long quotation. The browser inserts line breaks and margins for a blockquote element.A short quotation: "This is a short quotation"The q element does not render as anything special.
Link to comment
Share on other sites

According to this http://w3schools.com/tags/tryit.asp?filena...blockquote_test the browser inserts whitespace before and after the blockquote element, and adds margins on the left and right.This example of the <address> element has <br> elements on every line:http://w3schools.com/tags/tryit.asp?filename=tryhtml_addressCan you show me an example of these elements behaving as preformatted text?

Link to comment
Share on other sites

Well of course you are right. How in the world I missed the break tags I'm not positive, but. when I am studying, I have the habit of copying things and undoubtedly must have omitted the break tags. I must be getting tired or something. Sorry for the confusion.I will have to take a slower approach, I believe, so I don't wreck again.Thanks for straightening me out, I really appreciate it. :) As a side note, is there some way to insert pictures in this forum. I haven't a Web site yet. Can we upload to the forum?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...