Explain me what's the difference between HTML and XHTML?
Submitted by: MuhammadXHTML is an HTML that follows the XML rules, which means a XHTML document must have well-formed markups in order to be rendered properly in all web browsers. Differently from XHTML, the HTML document can be rendered in most of the browsers even with markup errors such as no closing tags or wrong nested tags.
And how do I create a XHTML document?
XHTML is basically a HTML document with some rules that need to be applied. Have a look at these examples below and spot the differences.
<head>
<title>This is head</title>
</head>
<BODY>
This is the body of the document with body tag in capital letters
Notice that there's no close body tag and no tag as well.
This HTML document above can be opened with no problems in Chrome, even containing many markup errors because most browsers can fix them for you automatically.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
</body>
</html>
The code above is a well-formed XHTML document and that's the minimum you must have in order to render it. Notice the declaration of the doctype at the top of the document and the namespace (xmlns) attribute in html open tag. These elements are mandatory as well as all the tags in lowercase.
Submitted by: Muhammad
And how do I create a XHTML document?
XHTML is basically a HTML document with some rules that need to be applied. Have a look at these examples below and spot the differences.
<head>
<title>This is head</title>
</head>
<BODY>
This is the body of the document with body tag in capital letters
Notice that there's no close body tag and no tag as well.
This HTML document above can be opened with no problems in Chrome, even containing many markup errors because most browsers can fix them for you automatically.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
</body>
</html>
The code above is a well-formed XHTML document and that's the minimum you must have in order to render it. Notice the declaration of the doctype at the top of the document and the namespace (xmlns) attribute in html open tag. These elements are mandatory as well as all the tags in lowercase.
Submitted by: Muhammad
Read Online Front End Developer (AngularJS) Job Interview Questions And Answers
Top Front End Developer (AngularJS) Questions
☺ | What is AngularJS? What are the key features of AngularJS? Is there any down-side of using AngularJS? |
☺ | What is an IIFE? |
☺ | Explain me your workflow when you create a web page? |
☺ | How can you add a method to a class already defined? |
☺ | Why is this project called "AngularJS"? Why is the namespace called "ng"? |
Top Scripting language Categories
☺ | AngularJS Interview Questions. |
☺ | Ext-JS Interview Questions. |
☺ | Dojo Interview Questions. |
☺ | Expert Developer JavaScript Interview Questions. |
☺ | jQuery Mobile Interview Questions. |