Solved

css  !DOCTYPE

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
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…

773 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