Solved

css  !DOCTYPE

Posted on 2010-11-29
4
269 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 250 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 250 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this tutorial viewers will learn how to style different bullet points for unordered lists in CSS. Begin with a normal unordered list; the default bullet point is a solid circle: In the CSS, create a defined class of unordered list by typing "ul.S…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

821 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