Jump to content

Validation Warnings


SillyBilly

Recommended Posts

I'm confussed about the warnings I get when I validate using Tidy. The code is,

<!--DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN "http://www.w3org/TR/html4/loose.dtd"--><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta name="generator" content="HTML Tidy for Linux/x86 (vers 1st November 2002), see www.w3.org"><meta http-equiv="Page-Enter" content="revealTrans(Duration=3.0, Transition=13)"><link rel="stylesheet" type="text/css" href="mystyle.css"><style type="text/css">@media print {

The warnings are,1. Warning: [style] lacks "type" attribute[style]2. warning: [style] isn't allowed in

 elements[style type=text/css](square brackets replacing greater than and less than)Any comments and suggestions would be appreciated.
Link to comment
Share on other sites

Whoa, I can see the problem just by looking at your code. You should really read through the W3schools tutoriuals. anyway...Problem #1: You are using 2 DTD's you only need one and both of them are not correct, this is the right one:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

Problem #2: The basic HTML setup is not correct, this is the correct way:

<html><head></head><body></body></html>

problem #3: if you are going to use an XHTML transtional DTD, make sure you have backslash on nonclosing tags like:

<link rel="stylesheet" type="text/css" href="mystyle.css" />

Problem #4: Your <style> and element tags were not closed. You should have it:

<style type="text/css">  @media print {}</style>

in summary, your code should look something like this:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html><head><meta name="generator" content="HTML Tidy for Linux/x86 (vers 1st November 2002), see www.w3.org" /><meta http-equiv="Page-Enter" content="revealTrans(Duration=3.0, Transition=13)" /><link rel="stylesheet" type="text/css" href="mystyle.css" /><style type="text/css">@media print {}</style></head><body></body></html>

edit: If you have any more questions, please feel free to ask. M'kay

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...