Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

XHTML

XHTML HTML xhtml

  • Please log in to reply
6 replies to this topic

#1 toxifyshadow

toxifyshadow

    CC Addict

  • Just Joined
  • PipPipPipPipPip
  • 120 posts

Posted 10 April 2010 - 08:25 AM

You might have seen weird html tags that look like <br />, and you might be wondering what their for. If thats true then I'm here to explian it to you.

XHTML is a cleaner, stricter version of html, it has the same tags and all, but those tags must have a closing tag!
by a closing tag I mean things like </font></body></script></style>etc...
What about <p>?
The paragraph tag is alittle different from html, it has the end tag, <p>Hello CodeCall</p>

And tags that normally don't have a closing tag?

With tags like <br><hr>etc..., at the end of those tags add a space and a slash like <hr />

What is it used for?

It is used for XML which stands for eXtensible Markup Language. In XML you define your own tags, such as <pet></pet><house></house>, there are no predefined tags, so you use XHTML.
Also about XML, don't use css to style it, there is a XML lanuage for it, look on w3schools.
It could also be used to keep your html clean.

Lists?
List may be confusing, you would think to use <li /> but really you use:
<li>A point</li>
<li>Cds</li>
<li>Milk</li>
<li>etc...</li>

Sorry about my mis-info I gave earlier, I did reserch and the correct way is <li>Bob</li>
Here is a page written in xhtml
<html><head><title>My XHTML Page</title></head>
<body>
<p>Welcome to my XHTML page!
I hope you enjoy it!</p>
<ul>
<h1>My list of pets!</h1>
<ol>
<li>Cat</li>
<li>Dog</li>
<li>Fish</li>
<li>Mouse</li>
<li>Water Snail</li>
</ol>
<br />
<hr />
<p>I hope you liked my example</p>
<br /><br /><br /><br /><br /></body></html>
If you have any more questions or comments please post them! :D

Edited by toxifyshadow, 13 April 2010 - 03:06 PM.

  • 0
Posted Image

#2 semprance

semprance

    CC Addict

  • Just Joined
  • PipPipPipPipPip
  • 118 posts

Posted 13 April 2010 - 12:26 PM

I didn't realise you could place the content of the old-style li tags (like "<li>A point</li>") after a tag that opens and closes in the same token.

Does the tag and value have to be on the same line though? Or is it just everything that follows after "<li />" until the next opening tag?

Also have you got a stray "<ol>" tag in there? Not sure if it was intentional but I don't think it gets closed anywhere.
  • 0

#3 toxifyshadow

toxifyshadow

    CC Addict

  • Just Joined
  • PipPipPipPipPip
  • 120 posts

Posted 13 April 2010 - 02:41 PM

I didn't realise you could place the content of the old-style li tags (like "<li>A point</li>") after a tag that opens and closes in the same token.

Does the tag and value have to be on the same line though? Or is it just everything that follows after "<li />" until the next opening tag?

Also have you got a stray "<ol>" tag in there? Not sure if it was intentional but I don't think it gets closed anywhere.


Opps, I ended ol with ul, thanks. It was accidental.
Also, becuase xhtml is a much stricter version or html, I would suggest keeping the tag and value on the same line, I'm not sure if it will error or anything but I would suggest to keep <li>A point</li> on the same line.
If it is possible to do <li /> then multi-line might be ok, I haven't worked much with lists, sorry.
  • 0
Posted Image

#4 semprance

semprance

    CC Addict

  • Just Joined
  • PipPipPipPipPip
  • 118 posts

Posted 13 April 2010 - 02:44 PM

Trial and error then I guess. I'll give it a try next time I'm editing a page with lists on. Cheers for the tips anyhow.
  • 0

#5 toxifyshadow

toxifyshadow

    CC Addict

  • Just Joined
  • PipPipPipPipPip
  • 120 posts

Posted 13 April 2010 - 02:48 PM

Actually I just did reserch, use <li> A point </li>
Edit: Sorry this post was simple I never realised you were online so I did some list reserch and the correct way is
<ol>
<li>Milk</li>
<li>Cheese</li>
<li>Bread</li>
</ol>
Not sure about multi-line though, I would stick to 1 line.
  • 0
Posted Image

#6 semprance

semprance

    CC Addict

  • Just Joined
  • PipPipPipPipPip
  • 118 posts

Posted 13 April 2010 - 03:19 PM

Ah ok, that's how I normally do a list.
  • 0

#7 toxifyshadow

toxifyshadow

    CC Addict

  • Just Joined
  • PipPipPipPipPip
  • 120 posts

Posted 13 April 2010 - 03:32 PM

:cool:
  • 0
Posted Image





Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download