/    Sign up×
Community /Pin to ProfileBookmark

If you view this page in IE everything will come out nicely, but when adding a doctype to it and view it in IE or in any other browser my lay-out gets messed up. If anyone has a solution for this problem i’m eager to listen. And don’t worry about the extension, because there isn’t any coding in it.

Without:
[url]http://digec.greatcorners.com/main/temp/index.php[/url]

With:
[url]http://digec.greatcorners.com/main/temp/index_doc.php[/url]

CSS-file:
[url]http://digec.greatcorners.com/main/temp/style.css[/url]

to post a comment
CSS

8 Comments(s)

Copy linkTweet thisAlerts:
@David_HarrisonMay 09.2004 — Well when you use a DTD it puts the browser into standards compliance mode (I use that term loosely for IE). If you do not use a DTD then the browser stays in quirks mode.

Since you have probably designed your layout in IE without using a DTD your layout goes wrong when you add one.

The only thing for it is to re-make your layout using a DTD and have your page open in several browsers to make sure that it's reasonably similar in all of them.
Copy linkTweet thisAlerts:
@Bootsman123authorMay 09.2004 — I tried to rewrite the css so it worked with a doctype, but I decided to quit after a few hours. So i'm really hoping someone has done this before or has a solution for this.
Copy linkTweet thisAlerts:
@FangMay 09.2004 — As [B]lavalamp[/B] wrote a [URL=http://www.w3.org/QA/2002/04/valid-dtd-list.html]valid DTD[/URL] is a must have.

I often use this basic template:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="nl">
<head>
<title>Basic HTML</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="copyright" content="Basic HTML">
<meta name="keywords" content="Basic HTML">
<meta name="description" content="HTML template">

<script type="text/javascript">
//<![CDATA[
<!--
// all JavaScript here

//-->
//]]>
</script>

<style type="text/css">
<!--
/* cascading style sheet */

-->
</style>

</head>
<body>
<!-- html here -->

</body>
</html>
Copy linkTweet thisAlerts:
@Bootsman123authorMay 09.2004 — I know I should use a doctype and I'm wanting to use one now, but I just can't get my code to work.
Copy linkTweet thisAlerts:
@ray326May 10.2004 — Run your CSS through a validator and see if it gives you some useful clues.
Copy linkTweet thisAlerts:
@FangMay 10.2004 — The 100% height only works in [URL=http://gutfeldt.ch/matthias/articles/doctypeswitch/table.html]quirks mode[/URL].

Is this page the layout for the rest of your site or just the opening page?

As layout: explain/show how a general page would work.

As opener: position elements absolutely.

Do use a "srandard mode" DTD, it will make x-browser layout easier.
Copy linkTweet thisAlerts:
@David_HarrisonMay 10.2004 — I'm about half way through a design, I'm currently battling my way past an IE bug at the moment. I've use a very wide image for the background to create the two left and right sections, then I've absolutely positioned two div tags of width:50%.

I'll work on it more when I get home.
Copy linkTweet thisAlerts:
@Bootsman123authorMay 10.2004 — I only use it as an opener. Thanks for all the help already. I'll try some more later this evening and let you know how it works out.
×

Success!

Help @Bootsman123 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.27,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...