Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

css  !DOCTYPE

Posted on 2010-11-29
4
Medium Priority
?
275 Views
Last Modified: 2012-06-27
Hi,

I was running follwoing example
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<style type="text/css">
table
{
border-collapse:collapse;
}
table, td, th
{
border:1px solid black;
}
</style>
</head>

<body>
<table>
<tr>
<th>Firstname</th>
<th>Lastname</th>
</tr>
<tr>
<td>Peter</td>
<td>Griffin</td>
</tr>
<tr>
<td>Lois</td>
<td>Griffin</td>
</tr>
</table>
<p><b>Note:</b> If a !DOCTYPE is not specified, the border-collapse property can produce unexpected results.</p>
</body>
</html>

Open in new window




I have not understood

>>>If a !DOCTYPE is not specified, the border-collapse property can produce unexpected results.


why we need to specify it.

any links, ideas, resources highly apprecuated. thanks in advnace
0
Comment
Question by:gudii9
  • 2
4 Comments
 
LVL 18

Accepted Solution

by:
Sudaraka Wijesinghe earned 1000 total points
ID: 34236452
DOCTYPE is an instruction to the web browser about what version of the markup language the page is written in.

The doctype declaration refers to a Document Type Definition (DTD). The DTD specifies the rules for the markup language, so that the browsers can render the content correctly.

http://www.w3schools.com/tags/tag_doctype.asp
0
 
LVL 2

Assisted Solution

by:getnitincr
getnitincr earned 1000 total points
ID: 34236469
According to HTML standards, each HTML document requires a document type declaration. The "DOCTYPE" begins the HTML document and tells a validator which version of HTML to use in checking the document's syntax.

Using different doctype dtd may result in different output.CSS is related to html DOMobject
0
 
LVL 2

Expert Comment

by:getnitincr
ID: 34236476
http://htmlhelp.com/tools/validator/doctype.html
you can go through above link for more details
0
 
LVL 7

Author Comment

by:gudii9
ID: 34240303
I have not understood
>>>Using different doctype dtd may result in different output.CSS is related to html DOMobject

how CSS is related to html DOMobject . please advise
0

Featured Post

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
Originally, this post was published on Monitis Blog, you can check it here . Websites are getting bigger and more complicated by the day. Video, images and custom fonts are all great for showcasing your product or service. But the price to pay in…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question