List of HTML tags and attributes removed from HTML5:
Element | Use instead |
paragraph alignment | CSS |
<basefont> | CSS |
<big> | CSS |
<small> | CSS |
<center> | CSS |
<font> | CSS |
<frame> | - |
<frameset> | - |
<noframes> | - |
<strike> | CSS |
Example: basefont
Specify a default text color, font size, font face for all the text on the page.
<head> <basefont color="red" size="5" face="Comic Sans MS"> </head>
Example: big and small
big tag make the text size as 4, and small tag make the text size as 2. Default
text size is 3.
<p> <big> Bigger text than Normal </big> </p>
<p> <small> Smaller text than Normal </small> </p>
Example: Base Hyperlink
If the hyperlink url is invalid or unable to open then it automatically redirect into a url specifed in base hyperlink
<head> <base href="http://www.AnkitWebLogic.com/" target="_blank"> </head>
Usefull HTML/HTML5 Tips
- Mixing of uppercase and lowercase for element name is bad, lower is recommended
- Close All HTML Elements
- Close All Empty HTML Elements
- Use Lower Case Attribute Names
- Spaces around equal signs is legal, But space-less is easier to read
- Make the title as meaningful as possible
- To ensure proper interpretation, and correct search engine indexing, both the language and the character encoding should be defined as early as possible in a document
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>HTML5 Syntax and Coding Style </title>
</head>
- Place the opening bracket on the same line as the selector.
- Use one space before the opening bracket.
- Use 2 spaces of indentation.
- Use colon plus one space between each property and its value.
- Use space after each comma or semicolon.
- Use semicolon after each property-value pair, including the last.
- Only use quotes around values if the value contains spaces.
- Place the closing bracket on a new line, without leading spaces.
- Use Lower Case File Names
- There is no difference between the .htm and .html extensions.
- When a URL does not specify a filename (like http://www.ankitweblogic.com/html5/), the
server returns a default filename like index.html, index.htm, default.html, and default.htm.
- If your server is configured only with "index.html" as default filename, your file must be named "index.html", not "index.htm."