Search Engine Optimization > Webmaster World > Converting from HTML to XHTML
Converting from HTML to XHTML
Posted by Dario D. on February 23rd, 2004

Hi all,

I'm converting my pages from HTML to XHTML and I have some questions:

- When quoting something using <blockquote>, do I need to put my text
inside a paragraph? E.g. <blockquote><p>Text</p></blockquote>
- What's the XHTML equivalent of <hr noshade>?
- Are there any common tag attributes that must be set explicitly in
order to avoid the tags appearing differently on various browsers? E.g.
someone suggested that I use this for the <p> tag:

p {
margin: 1em 0;
}

Since Opera uses a different margin setting than other browsers.

--
Dario D.

Posted by GreyWyvern on February 23rd, 2004

On Mon, 23 Feb 2004 21:20:02 +0100, Dario D. <darioNOSPAM@dariodjuric.com>
wrote:

First: do you have a good reason? XHTML is nice and all, but usually not
necessary unless your aim is to eventually learn XML.

Yes.

<hr style="height:0px;border-top:2px solid #808080;text-align:center;" />

This is a myth. Opera handles margin values exactly the same as other
browsers. What Opera *does* do differently is refrain from applying these
default margins to empty <p> tags. Only someone planning on using <p></p>
as spacers like so:

<p></p>
<p></p>
<p></p>
<p></p>

.... would bother setting a property like margin:1em 0; for <p> tags.

Grey

--
The technical axiom that nothing is impossible sinisterly implies the
pitfall corollory that nothing is ridiculous.
- http://www.greywyvern.com - Orca RingMaker: PHP web ring creation and
management

Posted by Makrobicz on February 23rd, 2004



"Dario D." <darioNOSPAM@dariodjuric.com> wrote in message
news:c1dn98$r2h$1@brown.net4u.hr...

Think about the semantics and you can't go too far wrong.

Use the <p> tag ONLY for paragraphs and ALWAYS for paragraphs.

With regards to "common tag attributes" There are several, even the margins
around <hx> can vary. My advice would be to allow the design to be able to
handle the defaults in any browser and enable the user to change the size
without your site falling apart. Remember your style sheet is only a
suggestion to the rendering engine, it can be over-ridden.

Good luck,
Mak.
--
"He [Jimmy White] has popped out to the toilet to compose himself before the
final push."
(STEVE DAVIS, BBC2)

http://www.private-eye.co.uk



Posted by Dario D. on February 23rd, 2004

GreyWyvern wrote:

Yes, exactly my aim.

A while back (you might remember), I had a problem with a right-aligned
screenshot box appearing differently on Opera. Setting the <p> margin
explicitly fixed the problem.

Anyway, thanks for your help.


--
Dario D.

Posted by Louis Somers on February 23rd, 2004

GreyWyvern <SP_bhuisman@greywyvern.com_AM> wrote in
newspr3ubhnozv0in9v@news.nas.net:

This also seems to validate: <hr noshade="noshade" />

--
Add articles with optional images to news/events pages via FTP
News Updater: http://www.xmlssoftware.com/NUpdater

Posted by William Tasso on February 23rd, 2004

Dario D. wrote:
Why?

What is to be gained?

--
William Tasso



Posted by GreyWyvern on February 24th, 2004

On 23 Feb 2004 22:36:06 GMT, Louis Somers
<removethis.info@nospam.xmlssoftware.com> wrote:

AFAIK, that validates in XHTML Transitional, but not in XHTML Strict.

Grey

--
The technical axiom that nothing is impossible sinisterly implies the
pitfall corollory that nothing is ridiculous.
- http://www.greywyvern.com - ORCA - Camouflaged PHP Web Scripts.

Funbolt.com - Entertainment portal, wallpapers, sexy celebs