473,654 Members | 3,109 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HTML UPPER case or lower case?

Should HTML 4.01 Strict markup be done in upper case or in lower case?
I understand that HTML allows either upper or lower case. I also notice
that XHTML apparently requires lower case. However I saw some mention
that the HTML DOM uses upper case for markup elements.

So, should I worry about what this means?

I am inclined to go with lower case, for two reasons.

Easier to change if I subsequently want to use XHTML.
Easier to type.

--
http://www.ericlindsay.com
Nov 23 '05 #1
19 26436
In article <NO************ *************** *****@freenews. iinet.net.au>,
Eric Lindsay <NO**********@e riclindsay.com> wrote:
I am inclined to go with lower case, for two reasons.

Easier to change if I subsequently want to use XHTML.
yep.
Easier to type.


yep.

You answered your own question :-)
I used to make my elements upper case because I think I saw it
somewhere, sometime, a long time ago. I had my text editor convert them
to lower case a few years ago.

leo

--
<http://web0.greatbasin .net/~leo/>
Nov 23 '05 #2
In article <NO************ *************** *****@freenews. iinet.net.au>,
Eric Lindsay <NO**********@e riclindsay.com> wrote:
Should HTML 4.01 Strict markup be done in upper case or in lower case?
I understand that HTML allows either upper or lower case. I also notice
that XHTML apparently requires lower case. However I saw some mention
that the HTML DOM uses upper case for markup elements.


As a caveat to my previous post, I've always used uppercase in the
places I've understood it to be in a DTD. From <html> to </html>, I use
lowercase.

leo

--
<http://web0.greatbasin .net/~leo/>
Nov 23 '05 #3
Tim
On Tue, 15 Nov 2005 09:50:26 +1000, Eric Lindsay sent:
Should HTML 4.01 Strict markup be done in upper case or in lower case?
Doesn't matter.
I am inclined to go with lower case, for two reasons.

Easier to change if I subsequently want to use XHTML.
If you were converting an HTML document to XHTML, your best bet would
probably to use a tool designed to do so. As well as making sure that
it's correctly formed, upper- vs lower-case wise, it takes care of other
things, to.
Easier to type.


As good a reason as any.

--
If you insist on e-mailing me, use the reply-to address (it's real but
temporary). But please reply to the group, like you're supposed to.

This message was sent without a virus, please destroy some files yourself.

Nov 23 '05 #4
Eric Lindsay wrote:
Should HTML 4.01 Strict markup be done in upper case or in lower
case? I understand that HTML allows either upper or lower case. I
also notice that XHTML apparently requires lower case. However I saw
some mention that the HTML DOM uses upper case for markup elements.

So, should I worry about what this means?
Not at all. Elements in HTML 4.01 Strict (or all pre-XHTML versions of
HTML, for that matter) are case-insensitive, meaning that it doesn't
matter if you have your tags in upper or lower case.

The examples you've seen sometimes use upper case tags (with lower case
attributes) are just to show a form of seperation between HTML tag
elements and all other text. It also helps some people read and
maintain their own HTML code.

Same thing goes for indentation. There's no requirement that your code
must be indented or on separate lines, other than that the DOCTYPE
element must be on top and on a line by itself. Indentation and line
breaks does, however, serve for easier maintenance by the creator and
other coders that needs to update the HTML page at later times.
I am inclined to go with lower case, for two reasons.

Easier to change if I subsequently want to use XHTML.
Easier to type.


Exactly. So if you're planning on switching to XHTML at a later point,
lower case code would help. Then it's just a matter of switching the
DOCTYPE, closing all tags (both empty and non-empty) and make sure tags
are properly nested (in other words: fix all validation errors, one by
one).

--
Kim André Akerĝ
- ki******@NOSPAM betadome.com
(remove NOSPAM to contact me directly)
Nov 23 '05 #5
Kim André Akerĝ wrote:
Same thing goes for indentation.
Nope. Indentation can be significant. Case distinction in element and
attribute names (and in enumerated attribute values) in HTML isn't.

Consider this:

<td><img ...>
</td>

This is by HTML definition equivalent to

<td><img ...></td>

Contrast this with

<td><img ...>
</td>

(i.e. with one-character indentation). It is equivalent to

<td><img ...> </td>

This can make a difference when a browser thinks that it needs to render
the space (which is a foolish idea, but browsers do such things).

On the practical side, most browsers get the first equivalence wrong
(they never bothered learning to parse HTML correctly) and produce the
same effect as in the second case. This, in turn, implies that using
"prettyprin ted" layout in HTML is risky. You need to know what you doing
and how whitespace can be significant.
There's no requirement that your code
must be indented or on separate lines, other than that the DOCTYPE
element must be on top and on a line by itself.
Where did you get that idea about the "DOCTYPE element"? (It ain't no
element, BTW.)
So if you're planning on switching to XHTML at a later point,
lower case code would help. Then it's just a matter of switching the
DOCTYPE, closing all tags (both empty and non-empty) and make sure tags
are properly nested (in other words: fix all validation errors, one by
one).


Actually, it's more, and less. It's more e.g. because the content model
of <script> and <style> are different in XHTML. It's less because HTML,
too, requires proper nesting. Lower case vs. upper or mixed case is
perhaps the most trivial part of the conversion.
Nov 23 '05 #6
Jukka K. Korpela wrote:
Kim André Akerĝ wrote:
Same thing goes for indentation.
Nope. Indentation can be significant. Case distinction in element and
attribute names (and in enumerated attribute values) in HTML isn't.


Significant, yes. Required, no.

Although, I must admit indentation is significant in terms of adding
whitespace to the rendered document.
[snip code examples]
There's no requirement that your code
must be indented or on separate lines, other than that the DOCTYPE
element must be on top and on a line by itself.


Where did you get that idea about the "DOCTYPE element"? (It ain't no
element, BTW.)


Terribly sorry, I did mean "DOCTYPE declaration". It was late, and my
English tends to be heavily crippled at 4am (considering Norwegian is
my native language).
So if you're planning on switching to XHTML at a later point,
lower case code would help. Then it's just a matter of switching the
DOCTYPE, closing all tags (both empty and non-empty) and make sure
tags are properly nested (in other words: fix all validation
errors, one by one).


Actually, it's more, and less. It's more e.g. because the content
model of <script> and <style> are different in XHTML. It's less
because HTML, too, requires proper nesting. Lower case vs. upper or
mixed case is perhaps the most trivial part of the conversion.


To my defense, my thought process (along with my English) wasn't "all
there" when I typed out my post (for the reasons mentioned above), so
in hindsight, I admit I skipped a few sections.

HTML does require proper nesting, but with the buggy browsers, it's
easy to forget to close all open tags since it "appears to be working"
(an all-too-frequent quote from several of my coder acquaintances; not
word-for-word, however).

--
Kim André Akerĝ
- ki******@NOSPAM betadome.com
(remove NOSPAM to contact me directly)
Nov 23 '05 #7
On Tue, 15 Nov 2005, Jukka K. Korpela wrote:
<td><img ...>
</td>

This is by HTML definition equivalent to
<td><img ...></td>

Contrast this with
<td><img ...>
</td>

(i.e. with one-character indentation). It is equivalent to
<td><img ...> </td>


I don't get it!
http://www.w3.org/TR/html4/struct/text.html#whitespace
says "Line breaks are also white space characters."

--
Netscape 3.04 does everything I need, and it's utterly reliable.
Why should I switch? Peter T. Daniels in <news:sci.lan g>

Nov 23 '05 #8
On Tue, 15 Nov 2005 09:50:26 +1000, in
comp.infosystem s.www.authoring.html , Eric Lindsay
<NO**********@e riclindsay.com> in
<NO************ *************** *****@freenews. iinet.net.au> wrote:
Should HTML 4.01 Strict markup be done in upper case or in lower case?
I understand that HTML allows either upper or lower case. I also notice
that XHTML apparently requires lower case. However I saw some mention
that the HTML DOM uses upper case for markup elements.

So, should I worry about what this means?

I am inclined to go with lower case, for two reasons.

Easier to change if I subsequently want to use XHTML.
Easier to type.


PeRsOnAlLy I tHiNk ThAt We ShOuLd AlL uSe MaSsIvElY mIxEd CaSe. ThErE
iS tOo MuCh CoMmUnIcAtIoN aS iT iS. i JuSt DoN't KnOw If I sHoUlD
cOnSidEr SpAcEs AnD pUnCtUaTiOn.

(CoRrEcTiNg TyPo'S iS a BiTcH, tHoUgH.)
--
Matt Silberstein

Do something today about the Darfur Genocide

http://www.beawitness.org
http://www.darfurgenocide.org
http://www.savedarfur.org

"Darfur: A Genocide We can Stop"
Nov 23 '05 #9
Kim André Akerĝ <ki******@NOSPA Mbetadome.com> wrote:
Although, I must admit indentation is significant in terms of adding
whitespace to the rendered document.


It may, or it may not, as I explained.
Where did you get that idea about the "DOCTYPE element"? (It ain't no
element, BTW.)


Terribly sorry, I did mean "DOCTYPE declaration".


You didn't tell where you got the idea that the DOCTYPE declaration "must be
on top and on a line by itself". (It must appear before any element, but
whitespace and comments are allowed before it, though - not surprisingly -
IE gets this wrong in its DOCTYPE sniffing.)

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

Nov 23 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
8682
by: semovrs | last post by:
Hello, everyone! I would appreciate any input or advice on the following quite simple issue: If I search through a file list using grep -E '.*$' it will not pull files ending in JPG and files ending in png which is fine. However, I have some files ending in jpg (note - lower case) and it will not display them either. Why is that? Am I doing something wrong here and if so - what? It obviously is a regexp issue and not a grep issue because...
10
2928
by: David | last post by:
What can I do to accept either uppercase or lower case " y or n" in the program below.? any help will be appreciated #include <iostream> using namespace std; //class definigtion class Pizza {
22
6434
by: DJ | last post by:
Can someone tell me the library call that converts strings to lower case or retrns a new string that is lower case of the original, thanks im using <string> David
17
11214
by: Janice | last post by:
char* line = "abcd"; How to convert the line to upper case and print? Any option for printf to do this? Thanx
4
1784
by: Chris | last post by:
Hi, How can I programatically set Upper, Lower and Normal case on a label or text box controls? Thanks
9
2783
by: B Williams | last post by:
I have written some code that will take in a string and print out the reverse, but I also want it to check for upper and lower case and swap them. Will someone assist me? include <iostream> using std::cout; using std::cin; using std::endl; #include <string>
4
5145
by: silversnake | last post by:
Hi , dose one know the code for checking through a string for upper or lower case char's and reverse them of find ? thanks
5
3070
by: cfmx2008 | last post by:
Hi Guys, I hope you could help me to solve this problem. Here it is: I have a huge table of data. Some data are Lower case and some are upper case. these data could be changed by agents, But I want to keep the case. For example: if data is Lower case and it changed to upper case at the time of change it should be lower case again. I know sounds terrible, but this is the problem. any hints will be appreciated. thanks
2
2901
by: vhsb69 | last post by:
WeIrd - my I,O and P keys tyPe Out In uPPercase, everythIng else Is In lOwercase. Keys are nOt stIckIng. Any One gOt any Ideas? Please helP me I am very cOnfused.
0
8285
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8814
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8706
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8475
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8591
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6160
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4149
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4293
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1592
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.