| View previous topic :: View next topic |
| Author |
Message |
preetisharma
Joined: 02 Jan 2009 Posts: 2
|
Posted: Fri Jan 02, 2009 8:03 am Incorrect output for <UL TYPE...> |
|
|
|
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
|
Posted: Fri Jan 02, 2009 1:34 pm |
|
|
|
| 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
|
Posted: Sun Jan 04, 2009 4:53 am |
|
|
|
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
|
Posted: Sun Jan 04, 2009 7:09 am |
|
|
|
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
|
Posted: Sun Jan 04, 2009 9:10 am |
|
|
|
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
|
Posted: Sun Jan 04, 2009 10:51 am |
|
|
|
@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
|
Posted: Sun Jan 04, 2009 1:32 pm |
|
|
|
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
|
Posted: Sun Jan 04, 2009 1:59 pm |
|
|
|
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. |
|
|