marossity Posted September 26, 2009 Share Posted September 26, 2009 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 XHTMLNONESame 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 More sharing options...
Ingolme Posted September 26, 2009 Share Posted September 26, 2009 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 More sharing options...
marossity Posted September 26, 2009 Author Share Posted September 26, 2009 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 More sharing options...
Ingolme Posted September 26, 2009 Share Posted September 26, 2009 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 More sharing options...
marossity Posted September 26, 2009 Author Share Posted September 26, 2009 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.