[Top]
More advice for the full screen mode.
   
I list below all topic groups, which I have done according to subjects, which they handle. You can return to this topic group by using this menu and the link Table of topic groups on the top of the each page.
 
 
Search:
[Help]

Examples of illegal definitions

Topics

Illegal CSS definitions

I have used and met much illegal definitions, which doesn't work.

Hints to avoid problems

I put a list of tiny errors, which I have done and you can avoid. First of all, use the CSS validator of W3C as I have done (a member of Webstandards ask me to use it - and he was right - I have made tiny errors, which were difficult to find). In this list is also my recommendations, how stylesheets could work better in problematic situations.

If you want to make some CSS definitions to Netscape 4.0x, I give you special hints (some other hints - no return link to this page):

Illegal HTML 4.0 Transitional loose definitions

I'm not a professional to understand all W3C doc type definitions (and I'm sure that there is only few people, who understands them properly!), but I recommend to use HTML 4.0 Transitional, not the strict definition, where all HTML 3.2 level definitions (like ALIGN, bgcolor="white" TEXT="#3f3f3f" LINK="#3f3f3f" VLINK="#2f2f2f", FONT FACE) are removed (they are defined with CSS) and then supporting transitional documents concerning appearance of documents is extremely limited. In my mind HTML 3.2 align-definition are in many cases faster to define and also older browsers understand them. HTML 3.2 align definition can also override with CSS (<P style="text-align:justify;" align=center> is justified to CSS understanding browsers). It is quite easy to make proper documents with this doc type definition:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">

This is the strict definition:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">

strict.dtd cause inflexibility to element P - in many cases it is more reasonable to use the align attribute.

All hints in this page concerns however the loose dtd. My designing principle is however that all definitions, which are harmful to the full functionality of CSS should not be used. Following definition limits the functionality of CSS and that's why I can't recommend it:

<FONT FACE="Arial" COLOR="#3f3f3f">

This works well also with CSS even if it could be defined also by using CSS:

<FONT SIZE="+1">

There is however a trick to make font definitions to HTML 3.2 and 4.0 compliant without losing the flexibility of CSS. This works to Opera 3.60, MS IE 5.0 and Mozilla 5.0: Welcome, because in the css definition is .font-color {color:maroon;font-size:20px;}. The rule means that class, which have the name font-color is applied to all elements. This system brings more compatibility between HTML 3.2 and 4.0 style font definitions and all commercial page designer likes this!Footnote 3. This is in fact valid according to DTD, because FONT accept core attributes - look at the DTD:

"id ID #IMPLMS IED
class CDATA #IMPLMS IED
style %StyleSheet; #IMPLMS IED
title %Text; #IMPLMS IED">
...
%coreattrs;
%i18n;
size CDATA #IMPLMS IED
color %Color; #IMPLMS IED
face CDATA #IMPLMS IED>
CSS definitions don't tell about it, because it is against strict HTML principles! But remember, that browsers handles them a little bit different ways. Opera don't take font-size values from CSS if it is defined like <FONT SIZE="+1">. To use FONT, B, I is not recommend to use and they don't belong to the strict DTD. HTML 4.0 strict base on a little bit too academic page design philosophy!

If you want to use your HTML page in some as parts of XHTML or XML files, use always lower case letters in tags, attributes and css-files and use always termination tags to p and li and mark empty tags to img, br, hr like
- HTML TIDY automate this process except in some "empty" element (empty means in this case that the tag doesn't have normal termination tag). Remember: making XHTML and XML files must be much more careful as making ordinary HTML pages!

Illegal HTML 4.0 Transitional loose definitions

Most common errors using HTML 4.0 loose, which W3C validator give error messages:

Opera and MS IE 5.0 puts often horizontal scroll bar - it is for these browsers much more common than MS MS IE 4.x and Netscape 4.0x. There is however a trick, which helps in many cases. I have used width="100%", which might cause horizontal scroll bar, but using width="99%" it disappears.

There is however some situations, where to slipper from standards is sensible. At least this one:

Other validator services

Netmechanic

Also some commercial companies offer validator services, like Netmechanic

Other sites:
Netmechanic.

I have validates these pages with W3C and I Netmechanic complained many errors from a file.

Some comments to Netmechanic:
  1. It understand only certain type of DTD definition. This is okay for it: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">, but it doesn't allow to put file name "http://www.w3.org/TR/REC-html40/loose.dtd" after it - Incorrect - the file name is permitted. The robot has invalid list of accepted !DOCTYPE definitions!
  2. Doesn't accept empty titles (<TITLE></TITLE>) - in a way Netmechanic is right, but it should not handle it as erroneous HTML but it should give a comment. My comment: Because of search engines, it is sometimes sensible to try to avoid them to find pages. Using empty titles and this definition <META name=robots content=NOINDEX>,in meta tags, robots probably don't find pages. These are however matters of readiness - not of HTML validation!
  3. Don't accept empty definitions. I have put in a file ACTION="" - again in a way Netmechanic is right again, but I don't need any value - I admit, that this was only a trick to cheat the validator of WC3 - Netmechanic doesn't allow cheating, but it should give only a comment!.
  4. Doesn't accept other empty codes like <P></P>. This is worth to complain.
  5. But I found also other some real functionality errors in addition pf the first error. This is correct TITLE='Art box' and Netmechanic complained incorrectly!
    6
    = = = = = = = = = = = = = = = = = = = = = ^Error: "BOX'" is not a supported attribute for "A".
    And it doesn't keep this valid either:
    Title='"The heart" of my pages -partially in English'
    Single quotation marks and also nested quotation marks are permitted!

It is easy to put so, that also Netmechanic regards them valid, but the result of those kinds of validation services should react with reservations. However - guite good validating after fixing some errors.

Web Site garage

Other sites:
Web Site garage.
Some comments:

Footnote 1. Also the style attribute (style="") includes an embedded declaration. Some applications accept style="{}", which tells much better, that style attributes includes embedded declarations. But this is against the normal HTML attribute syntax, and Netscape 4.x accepts only style="". According to David Baron this is correct. But if I think about this matter deeper, I disagree. It is only an agreement, that the dominating syntax is normal HTML attribute syntax. Today style-attribute has the same kind of syntax as so-called javasripts, which use also ";" as the separation mark like onClick="uusikkunaa(); if(browser) nayta(10, 'b')"

There is also a terminological problem, which concens the "!important rule' - in my mind it is misleading to call it as a rule. Read another another footnote from my CSS-teaching pages ([S]). (Return)

Footnote 2. You can find from CSS1 definitions (4.5 The canvas following, but this doesn't work in any browser and today it should not work:

This rule allows: <HTML style="background: url(http://style.com/marble.png)">
<BODY style="background: red">
In the example above, the canvas will be covered with "marble". The background of the BODY element (which may or may not fully cover the canvas) will be red.

In my mind HTML should have the possibility to define styles to <HTML> like in the example of CSS1 and just now there is needless limitation in the CSS2 spesificattion

In fact many of the problems in displaying HTML and BODY are derived too loose definitions in CSS1, which Håkon Wium Lie and his collaborators had done:

The canvas is the part of the UA's drawing surface onto which documents are rendered. No structural element of a document corresponds to the canvas, and this raises two issues when formatting a document:
  • from where should the dimensions of the canvas be set?
  • when the document doesn't cover the whole canvas, how should this area be rendered?
A reasonable answer to the first question is that the initial size of the canvas is based on the window size, but CSS1 leaves this issue for the UA to decide. It is also reasonable to expect the UA to change the canvas size when the window is resized, but this is also outside the scope of CSS1.

HTML extensions have set a precedent for the second question: attributes on the BODY element set the background of the whole canvas. To support designers' expectations, CSS1 introduces a special rule to find the canvas background:

If the background value of the HTML element is different from transparent then use it, else use the background value of the BODY element. If the resulting value is transparent, the rendering is undefined.

Microsoft and Opera has made different conclusion and this kind of over loose definition cause fragmentation. Also CSS2 in my mind too loose concerning displaying borders in container elements HTML and BODY.

Read my suggestion. The canvas is the most import matter to remark, because just the canvas is the space, which all CSS definitions should be rendered! (Return)

Footnote 3. I have discussed about this matter. Commercial web designer use HTML 3.2 font definitions just for the compatibility and they are not ready to use only CSS based definitions, which doesn't work with Netscape 3.x. My solution is a compromise. There is more need to use class-definitions than using strict HTML, but font values can be exchanged from linked CSS-files. (Return)

[Top]
   
Copyright Tapio Markula 1999-2003, Salo, Finland
(table of topic groups, E-mail - add Tapio.Markula)
( tapio.markula@nic.fi)
Not into the public use without my permission. If you want to use my pages at some way read the copyrights.
Get Expression!

An editor for creating standard-compliant HTML and XML documents. Documents of this site have in most cases checked with HTML Tidy by Dave Ragget (W3C) and randomly with the official MarkUp Validation Service of W3C. The syntax of most pages in this site should conform with the XHTML 1.0 specification of W3C. Test this page!
Information about browsers, which render or print this site best.
[Get Opera!] [Get Mozilla!]
CSS-guide has been last edited 07.08.2004