Click to See Complete Forum and Search --> : DOCTYPE HTML and Css


HJC
01-05-2010, 10:50 PM
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
on my web page , should I need to have html docType? what even I add it or not , I can't get the stable display On Ie 7, Ie *, and firefox
my css is #page {
width: 860px;
margin-right:auto;
margin-left:auto;
}

#logo {
width: 800px;
height: 55px;
z-index: -1;
margin-right:auto;
margin-left:auto;
display:block;
}
#container {
width:860px;
margin-right:auto;
margin-left:auto;
font-size: 8px;
font-family: Arial, Helvetica, sans-serif;
}

Fang
01-06-2010, 12:04 AM
Always use a valid DTD
Show the full code that is giving the problem.

HJC
01-06-2010, 02:48 AM
The page is too long ! what I need to solve is
1) what is the valid DOCTYPE
2) if my page have head.jsp, which already including <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">. then on my contain .jsp page , should I still need to add html DOCTYPE?
3) I need the web form in the center of the scree, what ever browse I test.
Thank you:confused:

Fang
01-06-2010, 04:35 AM
1. You are using a valid DTD. valid DTD list (http://www.w3.org/QA/2002/04/valid-dtd-list.html)

2. Every page sholud have a DTD as the first line on the page.

3. Without seeing your css and html it's impossible to give a definite answer.
Try:<form style="margin:0 auto; padding:0; width:15em;" action="" method="post" name="form1">

HJC
01-13-2010, 10:43 PM
your suggestion is not work
page {

margin-right:auto;
margin-left:auto;

}

#logo {
width: 800px;
height: 55px;
z-index: -1;
margin-right:auto;
margin-left:auto;
display:block;
}
#container {
text-align: left;
margin-right:auto;
margin-left:auto;
font-size: 10px;
font-family: Arial, Helvetica, sans-serif;
}

#category{
text-align:left;
}
<div id="page">
<div id="logo" align="center"><a href="http://www.google.com/cedars">
<img src="top_banner.gif" alt="my Logo" border="0" /></a>
</div>
<center>
<div id="container">
<p class="big">
Students Application<%=param%>
</p>
thank you!

Fang
01-14-2010, 12:23 AM
#page {
width:???px;
margin-right:auto;
margin-left:auto;

}

HJC
01-14-2010, 12:49 AM
I did use
#page {
width: 860px;
margin-right:auto;
margin-left:auto;
text-align:left;

} at the first time , it work on Ie but not Firefox , I get error
Error: The stylesheet /css/basic.css was not loaded because its MIME type, "text/html", is not "text/css".
I call my css by
<link href="css/basic.css" rel="stylesheet" type="text/css" />:(

Fang
01-14-2010, 02:15 AM
Can you give a link?

Tancredi
01-14-2010, 12:58 PM
margin-right:auto; // achieves the same as not stating it.
margin-left:auto; // achieves the same as not stating it.

If you need to center a div use:

#page { margin: 0 auto; }

oh by the way...display:block; // all divs are block level elements.
its not necessary to add this rule.

Tancredi
01-14-2010, 01:04 PM
margin-left: auto;
margin-right:auto;
margin-top: 0

-- does not work --

margin: 0 auto;

the shorthand notation places it higher in the specificity order than the longhand form set as default.

Tancredi
01-14-2010, 01:06 PM
place this rule at the very top of the css. It may help in this matter.

* { margin: 0; padding: 0; }

rnd me
01-14-2010, 04:52 PM
it work on Ie but not Firefox , I get error
Error: The stylesheet /css/basic.css was not loaded because its MIME type, "text/html", is not "text/css".
I call my css by
<link href="css/basic.css" rel="stylesheet" type="text/css" />:(

your server has to set .css files as mimeType "text/css" for firefox to accept it. IE doesn't care about the mimetype.

fix your server and your page should work.

HJC
01-15-2010, 01:57 AM
Thank you for all the replys
1) How to set the server to accept text/css file?
2) if I set my css as internal it work , just external is not work , why?
thnak you
I use solaris
Thank you!

rnd me
01-15-2010, 04:23 AM
Thank you for all the replys
1) How to set the server to accept text/css file?
2) if I set my css as internal it work , just external is not work , why?
thnak you
I use solaris
Thank you!

i don't know why it's not serving css correctly, usually that sort of thing is automatic. I work on the client side, so i don't know what you need to do to correct it. Try asking on a server-focused forum, or searching for documentation on your setup.

Tancredi
01-15-2010, 05:32 AM
This is a complete and correct doctype declaration, including the UTF-8 encoding which is missing from your code and would fail validation.
If this does not work, then the problem is not a DTD problem.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>untitled</title>

<link rel="stylesheet" type="text/css" href="external.css" media="screen">

</head>
<body>

</body>
</html>

HJC
01-17-2010, 07:55 PM
Thank You for the reply.
I did have <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> in my head, the only different is I only use <html>
still the external css is not working , only the internal css , only for the few
#page {
width: 860px;
margin-right:auto;
margin-left:auto;
text-align:left;
}

#logo {
width: 800px;
height: 55px;
z-index: -1;
margin-right:auto;
margin-left:auto;
display:block;
}
#container {
width: 860px;
text-align: left;
margin-right:auto;
margin-left:auto;
font-size: 11px;
font-family: Arial, Helvetica, sans-serif;
}

Fang
01-18-2010, 05:44 AM
If you have added style tags to the external document it will not work correctly.

HJC
01-19-2010, 12:55 AM
what do you mean?

Fang
01-19-2010, 03:22 AM
If the document also has these tags<style type="text/css">
/* css rules here */
</style>

If you gave a link the problem would be easier to track down.

HJC
01-19-2010, 08:08 PM
No this case, before I put all in external css, no work , have to put them into internal
thank you

HJC
01-20-2010, 08:30 PM
I have a few td in one of my display page
<td><c:out value="${found.DueDate}"/></td>
<td><pre><c:out value="${found.DefferredPayDate}"/></pre></td>
and my css is table.displaytag {
padding: 0;
margin: 1px;
border: 2px solid #ccc;
width: 98%;
}
table.displaytag td {
font: normal 0.7em Verdana, Arial, Helvetica, sans-serif;
color: #000;
padding: 1px 2px 1px 2px;
margin: 1px;
}
table.displaytag td prev {
font: normal 0.7em Verdana, Arial, Helvetica, sans-serif;
color: #000;
padding: 1px 2px 1px 2px;
margin: 1px;
}

but my td have prev and not prev is different , how can I made my display to be same?
thank you!:(

Fang
01-21-2010, 04:13 AM
table.displaytag td prev I think that should be pre

HJC
01-28-2010, 04:11 AM
in my css I have
. break {page-break-inside: avoid}
in my html I have <tr class="break"><td><table><>table></td></tr>
I wan teverything inside tr is not break , bu tit looks like not work
why??:(

HJC
01-28-2010, 09:08 PM
what is the corre css for the following situation:o
<div id ="ss'' align="center">
<span style="color:#0000; size:2">
<table border="1">