Transitional DTD
It is supported by the older browsers which do not have inbuilt cascading style sheets supports. Several attributes are enclosed in the body tag which are not allowed in strict DTD.
Syntax:
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
Example: In this example we will see the code for writing an XHTML document with an example.
html
<? xml version = "1.0" encoding = "UTF-8" ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd"> < html xmlns = "http://www.w3.org/1999/xhtml" xml:lang = "en" lang = "en" > < head > < title >Transitional DTD XHTML</ title > </ head > < body bgcolor = "#dae1ed" > < div style="color:#090;font-size:40px; font-weight:bold;text-align:center; margin-bottom:-25px;">w3wiki</ div > < p style = "text-align:center;font-size:20px;" > A computer science portal</ p > < p style = "text-align:center;font-size:20px;" > Option to choose month: < select name = "month" > < option selected = "selected" >January</ option > < option >February</ option > < option >March</ option > < option >April</ option > < option >May</ option > < option >June</ option > < option >July</ option > < option >Augusy</ option > < option >September</ option > < option >October</ option > < option >November</ option > < option >December</ option > </ select > </ p > </ body > </ html > |
Output:
XHTML Introduction
XHTML or EXtensible HyperText Markup Language is a mix of HTML and XML, very similar to HTML but stricter. It’s like a rulebook for creating web pages that browsers easily understand. Unlike HTML, you have to be careful and follow the rules exactly. Most browsers support it. Just think of it as a more precise way to write web code.
Table of Content
- History
- Transitional DTD
- Strict DTD
- Frameset DTD
- Why use XHTML?
- Benefits of XHTML
- Difference Between HTML and XHTML