HTML Tutorial


 /help/HTML Help Forum   FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
RegisterRegister - Not registered yet? Got something to say? Join HTML Code Tutorial!
Incorrect output for <UL TYPE...>
Post new topic   Reply to topic    HTML Help Forum -> Errors
View previous topic :: View next topic  
Author Message
preetisharma



Joined: 02 Jan 2009
Posts: 2

PostPosted: Fri Jan 02, 2009 8:03 am     Incorrect output for <UL TYPE...> Reply with quote

The output showing for the different styles of <UL> tag is incorrect. All are being shown as discs. if the value is written in lowercase, the output comes out correct! eg

<UL TYPE="square">


[/list]
PayneLess Designs



Joined: 28 Feb 2007
Posts: 4289
Location: MS

PostPosted: Fri Jan 02, 2009 1:34 pm     Reply with quote

The web standards require all lowercase for tags and attributes. The old way is still functional in some cases, but best to code to the latest HTML 4.01 Standards. Whether you get forced to code properly also depends on the document type you are using and I hope you have a correct one for your pages.
preetisharma



Joined: 02 Jan 2009
Posts: 2

PostPosted: Sun Jan 04, 2009 4:53 am     Reply with quote

The following code from your website does not give the correct output. The output shown on the website is also incorrect. Check the un-ordered lists type ...


this code produces this
<UL TYPE=DISC>
<LI>coffee
<LI>tea
<LI>lemonade
</UL>
coffee
tea
lemonade

<UL TYPE=CIRCLE>
<LI>coffee
<LI>tea
<LI>lemonade
</UL>
coffee
tea
lemonade

<UL TYPE=SQUARE>
<LI>coffee
<LI>tea
<LI>lemonade
</UL>
coffee
tea
lemonade
PayneLess Designs



Joined: 28 Feb 2007
Posts: 4289
Location: MS

PostPosted: Sun Jan 04, 2009 7:09 am     Reply with quote

This produced the correct bullets:
Code:
<ul type="disc">
<li>coffee</li>
<li>tea</li>
<li>lemonade</li>
</ul>

<ul type="circle">
<li>coffee</li>
<li>tea</li>
<li>lemonade</li>
</ul>

<ul type="square">
<li>coffee</li>
<li>tea</li>
<li>lemonade</li>
</ul>


<li> tag requires a closing tag: </li>
sticks464



Joined: 31 Dec 2006
Posts: 2627

PostPosted: Sun Jan 04, 2009 9:10 am     Reply with quote

This code works in all modern browsers with or without an html doctype, but not IE.

Code:
<UL TYPE=DISC>
<LI>coffee
<LI>tea
<LI>lemonade
</UL>
coffee
tea
lemonade

<UL TYPE=CIRCLE>
<LI>coffee
<LI>tea
<LI>lemonade
</UL>
coffee
tea
lemonade

<UL TYPE=SQUARE>
<LI>coffee
<LI>tea
<LI>lemonade
</UL>
coffee
tea
lemonade
PayneLess Designs



Joined: 28 Feb 2007
Posts: 4289
Location: MS

PostPosted: Sun Jan 04, 2009 10:51 am     Reply with quote

@Sticks: This is still improperly coded and is a repeat of OP's???? As quoted from your wise post:
Quote:
Maybe if we were to improve our mind reading skills we could give more efficient and timely answers. I'm absolutely sure that is a skill you are attempting to improve on Ron. Maybe the individual doesn't need a timely answer.
sticks464



Joined: 31 Dec 2006
Posts: 2627

PostPosted: Sun Jan 04, 2009 1:32 pm     Reply with quote

According to html 4.01 specs
Quote:
1.2.1 Elements and attributes

Element names are written in uppercase letters (e.g., BODY). Attribute names are written in lowercase letters (e.g., lang, onsubmit). Recall that in HTML, element and attribute names are case-insensitive; the convention is meant to encourage readability.
Case-insensitive (i.e., user agents interpret "a" and "A" as the same).

Quote:
3.2.1 Elements

An SGML document type definition declares element types that represent structures or desired behavior. HTML includes element types that represent paragraphs, hypertext links, lists, tables, images, etc.

Each element type declaration generally describes three parts: a start tag, content, and an end tag.

The element's name appears in the start tag (written <element-name>) and the end tag (written </element-name>); note the slash before the element name in the end tag. For example, the start and end tags of the UL element type delimit the items in a list:

<UL>
<LI><P>...list item 1...
<LI><P>...list item 2...
</UL>

Some HTML element types allow authors to omit end tags (e.g., the P and LI element types). A few element types also allow the start tags to be omitted; for example, HEAD and BODY. The HTML DTD indicates for each element type whether the start tag and end tag are required.


So it boils down to the DTD (doctype) used and the requirement of each type.
Using a strict html doctype the code does not validate.
Using a transitional html doctype it does.

Without any doctype, 1 error
Quote:
no document type declaration; implying "<!DOCTYPE HTML SYSTEM>".


However, written the way it is IE still does not render correctly. As I have said before, the tutorials here need to be brought up to date. Then maybe, we could give advice and recommendations that would not confuse users.
PayneLess Designs



Joined: 28 Feb 2007
Posts: 4289
Location: MS

PostPosted: Sun Jan 04, 2009 1:59 pm     Reply with quote

You're beating a dead horse here. The code I've already given works in any browser. Use of uppercase tags and attributes is frown on and not the professional way to go even if you use a transitional document type where pretty much ANYTHING goes. If you are just playing arond with your first page, then write it anyway you want...even with deprecated tags. If you're serious or even plan to update pages at a later date, do it correctly from the start so you not only don't develop bad habits, but you don't have to go back and correct previous pages.

I would love to update the tutorials here, but I don't have that authority. Possibly put that suggestion in one of the other sections. I'm totally with you on that part.
Display posts from previous:   
Post new topic   Reply to topic    HTML Help Forum -> Errors All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
HTML Help Archive
Powered by phpBB © 2001, 2005 phpBB Group
HTML Help topic RSS feed 

 
DARFUR
HOSTING / DESIGN
MAKE MONEY

Home
  |   Tutorials   |   Forum   |   Quick List   |   Link Directory   |   About
Copyright ©1997-2002 Idocs and ©2002-2007 HTML Code Tutorial