These forums are currently read-only due to receiving more spam than actual discussion. Sorry.

It is currently Sat Dec 02, 2017 4:04 pm Advanced search

Integrating HTML5 :)

Here you can discuss things related to HTML and the Web in general that do not fit in to other categories.

Integrating HTML5 :)

Postby ktf » Fri Jul 25, 2008 8:46 am

I've integrated some HTML 5 tags in my website already: www.icer.nl

I've used the tags <article> and <nav>, because I want to be one of the first to use this feature when it gets integrated in search engine crawlers ;) At the moment it is some kind of quick and dirty solution, because the markup is still much like XHTML (with <br /> and things like that)

So, what about you? Would you sacrifice compatility (some browsers don't know how to handle the elements) to adopt HTML5?
ktf
<h6>
 
Posts: 8
Joined: Fri May 25, 2007 3:06 pm
Location: Somewhere in The Netherlands

Postby Le Sage » Fri Jul 25, 2008 7:15 pm

There as an interesting article in A List Apart called A Preview of HTML 5 (December 04, 2007 - by Lachlan Hunt) describing how web developers can already use HTML5.
I think that the default reaction of most browsers facing an unknown element (as for example <header>, <nav>, <article>, <section>, ...) is to ignore it, but display its content. Though, most browsers probably (this needs checking) still apply style on them (with a nicely written CSS). So if you wanna add sematic value to your web page, using <span> or using any other element I've mentioned on top should be without danger. Image
User avatar
Le Sage
<h3>
 
Posts: 54
Joined: Wed Dec 05, 2007 9:08 pm
Location: Casablanca, Morocco

Postby ktf » Sat Jul 26, 2008 8:29 am

Well, actualy i've tried to replace a div with a nav element, but Firefox doesn't seem to like it, it ignores the style too. So I've placed a div element in a nav element to get the same look.

Anyway, thanks for the link.
ktf
<h6>
 
Posts: 8
Joined: Fri May 25, 2007 3:06 pm
Location: Somewhere in The Netherlands

Postby Le Sage » Sat Jul 26, 2008 10:01 am

Image
Well, padding works for me, as background-color or other text-style changing. Width doesn't seem to be applied, but if is fixed if you apply a
Code: Select all
myNewHtml5Element {
  display: block;
}
in it (I guess elements are in-line by default, correct me if I'm wrong).
So once again I'm pretty sure you can do anything you want. Can you specify what you exactly can't do? Image
[ADD] by the way, it works for Firefox 3 (probably Firefox 2 too), Opera 9.5 (probably earlier versions too), but not IE7 Image (forcing the stylesheet to be applied which could easily be fixed with wise JavaScript, so this solution can according to me be deployed).
User avatar
Le Sage
<h3>
 
Posts: 54
Joined: Wed Dec 05, 2007 9:08 pm
Location: Casablanca, Morocco

Postby ktf » Sat Jul 26, 2008 12:05 pm

I tried in FF 2 to make nav a div-like with display: block; Well, I guess i did something wrong then ;) I'll try again as soon as I make my whole site html5-"compatible"
ktf
<h6>
 
Posts: 8
Joined: Fri May 25, 2007 3:06 pm
Location: Somewhere in The Netherlands

Postby OmegaJunior » Sun Jul 27, 2008 12:39 pm

Le Sage wrote:Image
Well, padding works for me, as background-color or other text-style changing. Width doesn't seem to be applied, but if is fixed if you apply a
Code: Select all
myNewHtml5Element {
  display: block;
}
in it (I guess elements are in-line by default, correct me if I'm wrong).
So once again I'm pretty sure you can do anything you want. Can you specify what you exactly can't do? Image
[ADD] by the way, it works for Firefox 3 (probably Firefox 2 too), Opera 9.5 (probably earlier versions too), but not IE7 Image (forcing the stylesheet to be applied which could easily be fixed with wise JavaScript, so this solution can according to me be deployed).


That's what I found too. I wrote an article about that over on myopera.com. I came to the conclusion that this behaviour by MSIE must be an executive decision: the browser itself is capable of handling unknown elements in XML and applying the provided CSS correctly; as such there is no technical reason for the browser to be unable to handle unknown HTML elements.
OmegaJunior
<h6>
 
Posts: 9
Joined: Sun Oct 07, 2007 1:37 pm
Location: Netherlands

Postby Le Sage » Sun Jul 27, 2008 1:08 pm

A little bit of JavaScript can always fix that (very easy to force a stylesheet to be applied with a JavaScript engine such as jQuery ; there might even be some scripts that already could parse CSS & apply it), so I guess that's not really a bug problem. Image
An example of real-life HTML 5 by Simon Pieters (zcorpan) : W3C home in HTML 5. Of course, IE7 doesn't like it, but IE8 might (haven't tested).
almost validates (might have to replace en-uk by en-GB).
User avatar
Le Sage
<h3>
 
Posts: 54
Joined: Wed Dec 05, 2007 9:08 pm
Location: Casablanca, Morocco

Postby zcorpan » Sun Jul 27, 2008 2:33 pm

To make the new elements stylable in IE, you just do
Code: Select all
<script>document.createElement('nav');</script>
before you use any of the new elements (e.g. in HEAD), and then the behavior of the parser magically changes. (credit)
zcorpan
<article>
 
Posts: 807
Joined: Tue Feb 06, 2007 8:29 pm
Location: Sweden

Postby zcorpan » Sun Jul 27, 2008 2:54 pm

Le Sage wrote:An example of real-life HTML 5 by Simon Pieters (zcorpan) : W3C home in HTML 5.
Well it's an experiment so I'm not sure how much of a "real-life" example it is... :)
Le Sage wrote:almost validates (might have to replace en-uk by en-GB).
Done. (Note that the actual w3.org home page still has this error.)
zcorpan
<article>
 
Posts: 807
Joined: Tue Feb 06, 2007 8:29 pm
Location: Sweden

Postby OmegaJunior » Mon Jul 28, 2008 5:07 am

Le Sage wrote:A little bit of JavaScript can always fix that (very easy to force a stylesheet to be applied with a JavaScript engine such as jQuery ; there might even be some scripts that already could parse CSS & apply it), so I guess that's not really a bug problem.


zcorpan wrote:To make the new elements stylable in IE, you just do
Code: Select all
<script>document.createElement('nav');</script>
before you use any of the new elements (e.g. in HEAD), and then the behavior of the parser magically changes. (credit)


Unfortunately that leaves out all those whose company decided Javascript in Internet Explorer a security risk and thus off limits. Any way to force this browser into behaving nicely without javascript?
OmegaJunior
<h6>
 
Posts: 9
Joined: Sun Oct 07, 2007 1:37 pm
Location: Netherlands

Postby Le Sage » Mon Jul 28, 2008 7:58 am

zcorpan wrote:and then the behavior of the parser magically changes

interesting trick
zcorpan wrote:(Note that the actual w3.org home page still has this error.)

Well I guess you didn't change the code from en-GC to en-uk yourself (just for the sake of not validating)! Image
OmegaJunior wrote:Unfortunately that leaves out all those whose company decided Javascript in Internet Explorer a security risk and thus off limits. Any way to force this browser into behaving nicely without javascript?

Are there any companies that both force users to use IE & block JavaScript ? Well, shouldn't be very fun to work at these companies, most of the web is broken for them. Image
No trick that I can think of.
By the way, is there any place I could submit a request for a user prefered language detection in JavaScript (DOM)? Maybe on this forum? Maybe on a W3C mail list? Maybe (probably) this issue has already been discussed?
User avatar
Le Sage
<h3>
 
Posts: 54
Joined: Wed Dec 05, 2007 9:08 pm
Location: Casablanca, Morocco

Postby zcorpan » Mon Jul 28, 2008 11:30 am

Le Sage wrote:By the way, is there any place I could submit a request for a user prefered language detection in JavaScript (DOM)? Maybe on this forum? Maybe on a W3C mail list?
whatwg@whatwg.org works.
Le Sage wrote:Maybe (probably) this issue has already been discussed?
I can't remember it being discussed, but perhaps it was before I joined the WHATWG. The spec has this section:
http://www.whatwg.org/specs/web-apps/cu ... calization
zcorpan
<article>
 
Posts: 807
Joined: Tue Feb 06, 2007 8:29 pm
Location: Sweden

Postby Le Sage » Mon Jul 28, 2008 11:51 am

Thanks, I'll write a thread on this forum & forward it to the mail you gave soon... hum, somewhat soon... Image
User avatar
Le Sage
<h3>
 
Posts: 54
Joined: Wed Dec 05, 2007 9:08 pm
Location: Casablanca, Morocco

Postby OmegaJunior » Tue Jul 29, 2008 8:05 am

zcorpan wrote:To make the new elements stylable in IE, you just do
Code: Select all
<script>document.createElement('nav');</script>
before you use any of the new elements (e.g. in HEAD), and then the behavior of the parser magically changes. (credit)


Tried that and seems to work in MSIE6, but not in Firefox2, nor MSIE8. Doesn't force MSIE6 to recognise { display: table-cell;} though ;)
OmegaJunior
<h6>
 
Posts: 9
Joined: Sun Oct 07, 2007 1:37 pm
Location: Netherlands

Postby Le Sage » Tue Jul 29, 2008 6:15 pm

Does Firefox 2 display the w3c test page from Simon correctly ? (sorry, I don't have any FF 2 anymore Image)
User avatar
Le Sage
<h3>
 
Posts: 54
Joined: Wed Dec 05, 2007 9:08 pm
Location: Casablanca, Morocco

Next

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest