473,771 Members | 2,394 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Changing doctype affects border and background

I'm trying to get my head around a problem that has me baffled.

The following element:

#wrapper {border:1px solid #000;background :#fff;}
Renders as expected when using this DTD:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
But when switching to this DTD:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
Neither the outline or background colour is rendered.

What am I missing?
Jul 21 '05 #1
34 4440
On Wed, 08 Jun 2005 13:50:04 +0200, The Good Son <go******@freeu k.com>
wrote:
I'm trying to get my head around a problem that has me baffled.

The following element:

#wrapper {border:1px solid #000;background :#fff;}
Renders as expected when using this DTD:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
But when switching to this DTD:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
Neither the outline or background colour is rendered.

What am I missing?


DOCTYPE switching. See for example

http://gutfeldt.ch/matthias/articles/doctypeswitch.html

Browsers are less forgiving of syntax errors, and some CSS properties are
interpreted more strictly, when you trigger Stabdards mode rendering by
using a 'modern' Doctype.

--
Get Opera 8 now! Speed, Security and Simplicity.
http://my.opera.com/Rijk/affiliate/

Rijk van Geijtenbeek

Jul 21 '05 #2
Rijk van Geijtenbeek wrote:
On Wed, 08 Jun 2005 13:50:04 +0200, The Good Son <go******@freeu k.com>
wrote:
I'm trying to get my head around a problem that has me baffled.

The following element:

#wrapper {border:1px solid #000;background :#fff;}
Renders as expected when using this DTD:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
But when switching to this DTD:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
Neither the outline or background colour is rendered.

What am I missing?

DOCTYPE switching. See for example

http://gutfeldt.ch/matthias/articles/doctypeswitch.html

Browsers are less forgiving of syntax errors, and some CSS properties
are interpreted more strictly, when you trigger Stabdards mode
rendering by using a 'modern' Doctype.


Why are you using XHTML? Personally I would go from
transitional to strict, but not HTML 4.0 Transitional to
XHTML 1.0 Strict. Please read:
http://www.hixie.ch/advocacy/xhtml for more info on the
problems this will create. Correct me if I'm wrong, but
going to XHTML and sending as text/html triggers quirks mode
on most browsers.

JL
Jul 21 '05 #3
Justin Lieb wrote:
Correct me if I'm wrong, but going to XHTML and sending as
text/html triggers quirks mode on most browsers.


Consider yourself corrected. This only happens with IE6 when the <?xml
line appears prior to the DOCTYPE.

Jul 21 '05 #4
C A Upsdell > wrote:
Justin Lieb wrote:
Correct me if I'm wrong, but going to XHTML and sending as text/html
triggers quirks mode on most browsers.

Consider yourself corrected. This only happens with IE6 when the <?xml
line appears prior to the DOCTYPE.


Regardless, when sending XHTML as text/html, browsers will
treat it as "tag soup". That is why I made the assumption
that XHTML sent as text/html would trigger quirks mode.
Thank you for correcting though!

JL
Jul 21 '05 #5
Justin Lieb wrote:
C A Upsdell > wrote:
Justin Lieb wrote:
Correct me if I'm wrong, but going to XHTML and sending as text/html
triggers quirks mode on most browsers.


Consider yourself corrected. This only happens with IE6 when the
<?xml line appears prior to the DOCTYPE.


Regardless, when sending XHTML as text/html, browsers will treat it as
"tag soup". That is why I made the assumption that XHTML sent as
text/html would trigger quirks mode. Thank you for correcting though!


Quirks Mode is standard with legacy browsers since they have only that.
IE 6 will trigger Quirks if the XML Declaration is used, otherwise it is
in Standards Mode. Gecko based, Opera, Safari and IE5/Mac will be in
Standards Mode.

As long as the document is compliant with Appendix C of XHTML 1.0 it
will be compatible with Tag Soup processors. You have to read the whole
document which you quoted.

--
Gus
Jul 21 '05 #6
Gus Richter wrote:
Justin Lieb wrote:
C A Upsdell > wrote:
Justin Lieb wrote:

Correct me if I'm wrong, but going to XHTML and sending as text/html
triggers quirks mode on most browsers.


Consider yourself corrected. This only happens with IE6 when the
<?xml line appears prior to the DOCTYPE.

Regardless, when sending XHTML as text/html, browsers will treat it as
"tag soup". That is why I made the assumption that XHTML sent as
text/html would trigger quirks mode. Thank you for correcting though!

Quirks Mode is standard with legacy browsers since they have only that.
IE 6 will trigger Quirks if the XML Declaration is used, otherwise it is
in Standards Mode. Gecko based, Opera, Safari and IE5/Mac will be in
Standards Mode.


Understood.

As long as the document is compliant with Appendix C of XHTML 1.0 it
will be compatible with Tag Soup processors. You have to read the whole
document which you quoted.


Read the whole document before quoting it, still didn't
understand quirks vs. standard in that context. Now I do.
But my original point still stands, XHTML is basically
pointless at this point in time, unless they want to use xml
tools with it.

JL
Jul 21 '05 #7

"Justin Lieb" <ju************ **@adelphia.net > wrote in message
news:t9******** ************@ad elphia.com...
Gus Richter wrote: <snip> Read the whole document before quoting it, still didn't understand quirks
vs. standard in that context. Now I do. But my original point still
stands, XHTML is basically pointless at this point in time, unless they
want to use xml tools with it.

JL


I disagree. My PHP web application has output XHTML for over two years, and
renders in IE, Opera and Firefox. The differences between "proper" HTML and
XHTML are minor.

--
Tony Marston

http://www.tonymarston.net

Jul 21 '05 #8
Thanks for the replies.

It's a requirement of the CMS we are using that our templates conform to
XHTML 1.0 strict.

Funny thing is, whilst the stylesheet entry is being ignored, I can add the
attributes to the element within the template and it adds the border and
background colour.
Jul 21 '05 #9
in comp.infosystem s.www.authoring.stylesheets, Tony Marston wrote:

"Justin Lieb" <ju************ **@adelphia.net > wrote in message
XHTML is basically pointless at this point in time, unless they
want to use xml tools with it.

Actually, people that use xml tools often say that is is easier to output
html than appendix C conforming xhtml...
I disagree. My PHP web application has output XHTML for over two years, and
renders in IE, Opera and Firefox. The differences between "proper" HTML and
XHTML are minor.


And point of using xhtml is? You could just fine use plain html4, right?

--
Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>
Utrecht, NL.
Support me, buy Opera:
https://secure.bmtmicro.com/opera/bu...tml?AID=882173
Jul 21 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
2547
by: Robert Misiorowski | last post by:
Hello, I have a very perplexing (at least to me) problem that hopefully someone can help me with. I'm making a site with a 3 column layout. In the middle column (my fluid column) I am trying to put a table of 99% width. When I do this the table actually extends to the right over my right column and off the screen. After much debugging and trying of different things, I change this line in my code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD...
6
5168
by: Patrick | last post by:
Hi I am fairly new to CSS and the web.I am trying to build a site more to practice my skills than for the site itself. I have been focusing on CSS and try my best to make it work in I.E 6.0, Opera 7.23, Mozilla 1.4 and N.N. 7.1. My site was doing fine until i read i was supposed to keep everything validated so i entered a strict html 4.01 doctype with url following.My HTML validated fine. So i validated my CSS and beside a little...
2
1744
by: Dominic Myers | last post by:
Hi there, wondered if someone could point me to an appropriate tutorial or offer advice on the following problem? I've got a web page which uses lots of divs to position the content of the page and I'm using a nice javascript to alter the css of a table of links. The thing is I don't want the table of links to point to an external site but to calla function which will replace the content of a layer... perhaps it's be better if I...
31
5724
by: Arthur Shapiro | last post by:
I'm the webmaster for a recreational organization. As part of one page of the site, I have an HTML "Calendar at a Glance" of the organization's events for the month. It's a simple table of a calendar, 7 across by whatever needed down, and I manually create it each month - not a big deal. Every day I go in and darken the background color of the current day's cell by changing the appropriate <TD> entry to <TD bgcolor="c63800"> and...
31
4158
by: Greg Scharlemann | last post by:
Given some recent success on a simple form validation (mainly due to the kind folks in this forum), I've tried to tackle something a bit more difficult. I'm pulling data down from a database and populating a simple table. I'd like the table to contain 10 entries per page and have the option for the user to scroll through the pages of data without having to go back to refresh the page (I've already pulled all the info I need from the...
8
3929
by: Bosconian | last post by:
I have two multiple select inputs. Initially the first contains a bunch of items and the second is empty. Using a common method, I move items back and forth by double clicking on them. This portion works perfectly, but I would also like to change the background color of the select element with the current focus. I have defined the following classes: ..selected {
13
3030
by: amykimber | last post by:
Hi all, I know I'm doign something really daft, but I can't get this to work... I have a form with a bunch of inputs called ship_owner - why the ? Because I'm submitting this page though php and the put the data into an array in the post.... anywhat. I have a link <a href="javascript:change_class()" >Block mode</a> to
0
3212
by: =?Utf-8?B?SGFyZHkgV2FuZw==?= | last post by:
Hi all, I have a web form, and I want to use ModalPopupExtender from Ajax Toolkit. I am using IE 7.0 as browser, VS 2005 and Ajax and Ajax Tool Kit installed. Windows XP Pro. Now I have a very strange problem. With 2nd line of code (DOCTYPE), I can popup modal dialog in middle of screen, BUT all my styles are lost, including modal popup is ugly. If I remove DOCTYPE I can see all my styles, BUT modal
17
4385
by: seajay | last post by:
Hello, I noticed something strange when I was composing a XHTML document with CSS The following DOCTYPE causes the page to display differently on Fireflox 1.0.6 and Internet Explorer 6 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http:// www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
0
9619
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10102
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10038
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8933
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7460
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2850
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.