473,786 Members | 2,426 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
34 4442
The Good Son wrote:
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.


Please provide the url of the page in question, I can't seem
to duplicate your problem. Here is the code I used with
both doctypes:

<html>
<head>
<title></title>
<style>
<!--
#wrapper {border:1px solid #000;background :#fff;}
-->
</style>
</head>
<body>
<div id="wrapper">So me Text...</div>
</body>
</html>

and it works fine for me in FF and IE6. I think you may
have stumbled upon an IE layer bug. Have a look at the
following page in two different browsers and notice how the
layers differ in color.

http://webdesign.crissov.de/temp/table-layers.html

JL
Jul 21 '05 #21
Lauri Raittila wrote:
If done like appendix C, support is not
currently much worse, but Appendix C is non normative, and thus not
standard.
Appendix C is used to support non-standard legacy browsers.


Yes. Remembering that legasy browsers is also IE6, which is 80% of
current browsers


Agreed - IE6 is the NS4 of today.
This site, served as text/html, does not work on your IE?
http://www.w3.org/TR/xhtml11/
Please expand on what does not work.


It is supposed to be served in text/xhtml+xml.


I accept this, but can you give an authoritive reference?
On the other hand, if XML is not incorporated in the document as well?
Also, the quoted page works well on all browsers, served as text/html.
You can serve it using
text/html, it is bad thing to do, but you can.
Can you be specific as to why it is a bad thing?
But that won't mean
XHTML1.1 works in IE, done as it should be done. Just as IE doesn't
support XHTML1.0 either, unless appendix C is followed. So, IE clearly
don't support XHTML - you can't just make correct xhtml document and
think that it works in IE.
But if you make document following the spec, you find out that IE won't
support it. And that it don't work.
What are you expecting XHTML to do at this point in time beyond making
sure that the document is conforming? How does it not work?
The way that I see it, XHTML 1.0 (and XHTML 1.1 for that matter), for
those of us that are not into incorporating XML, it is simply complying
with W3C by using the latest Recommendation, waiting for the browsers to
catch up by applying Appendix C and serving it up as text/html, which I
believe is W3Cs intension.
I have found in the past some rendering differences in some instances
(Opera for example, although this was some versions ago) when serving up
as text/xhtml+xml so I stayed with text/html.
If moving into the true XML world, with XML incorporation, then it must
be served up as text/xhtml+xml. I for one am not there yet, nor do I
have the need for now. I suspect that most people are in the same position.
And that document you refer gets quirks mode in IE...


Agreed - due to the XML declaration which is optional for the default of
UTF-8 or UTF-16. I guess that W3C wants the same rendition for IE5.5 and
IE6.

--
Gus
Jul 21 '05 #22
> Lauri Raittila wrote:

You can serve it using text/html, it is bad thing to do, but you can.

Gus Richter wrote:
Can you be specific as to why it is a bad thing?


I have already answered this before:

http://www.hixie.ch/advocacy/xhtml

JL
Jul 21 '05 #23
On 10/06/2005 18:01, Gus Richter wrote:
Lauri Raittila wrote:
[snip]
[A XHTML 1.1 document?] is supposed to be served in text/xhtml+xml.
application/xhtml+xml
I accept this, but can you give an authoritive reference?
I don't believe there is one, though
<URL:http://www.w3.org/TR/xhtml-media-types/> is probably as close as
you'll get.

[snip]
You can serve it using text/html, it is bad thing to do, but you can.


Can you be specific as to why it is a bad thing?


Appendix C was specified for XHTML 1.0, but no other versions. Whilst
one can serve a XHTML 1.0 document with the text/html content type
(though it's not recommended), one should only serve documents written
in other XHTML versions with application/xhtml+xml.

[snip]
What are you expecting XHTML to do at this point in time beyond making
sure that the document is conforming? How does it not work?
If an XHTML document is served as HTML, then all user agents will treat
it as such, whether they support XHTML or not. This means user agents
cannot utilise a simpler parser, and neither can they conform to the XML
parsing rule.
The way that I see it, XHTML 1.0 (and XHTML 1.1 for that matter), for
those of us that are not into incorporating XML, it is simply complying
with W3C
As far as I know, the W3C have not stated that documents should be
migrated to XHTML, so using HTML would still constitute some misguided
notion of compliance. Moreover, if you're that concerned about complying
with what the W3C recommends, you would accept that using the wrong
content type is, well, wrong.
by using the latest Recommendation


I'd say that's jumping on the latest bandwagon. Nothing more. XHTML
might be good for content management, and for serving documents to
mobile devices that can't handle a tag soup (HTML) parser, but not for
the Web in general. After all, what's the point in forcing every single
user agent to error correct every one of your documents?

[snip]

Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
Jul 21 '05 #24
The Good Son wrote:

If I switch the doctype back, it works. I want to understand why it is just
these two declarations that are ignored by the new doctype.


Unless you post a URL, all you'll get are guesses, albeit educated ones.

BTW, posting code instead of a URL isn't the same. People don't want to
be bothered having to make their own page from your code. Make it easy
for us to help you and you'll get better results. Posting a URL makes it
easier for us.

--
Reply email address is a bottomless spam bucket.
Please reply to the group so everyone can share.
Jul 21 '05 #25
Justin Lieb wrote:
Can you be specific as to why it is a bad thing?


I have already answered this before:

http://www.hixie.ch/advocacy/xhtml

A couple of questions:
1. Does using <meta http-equiv="Content-Type"
content="applic ation/xhtml+xml; charset=iso-8859-1" /> make any difference
to how the document is handled if the server header is "content-type:
text/html"?

2. How do I tell what moe IE6 is using for any given document?

--
jmm dash list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)
Jul 21 '05 #26
Jim Moe wrote:
Justin Lieb wrote:
Can you be specific as to why it is a bad thing?

I have already answered this before:

http://www.hixie.ch/advocacy/xhtml

A couple of questions:
1. Does using <meta http-equiv="Content-Type"
content="applic ation/xhtml+xml; charset=iso-8859-1" /> make any
difference to how the document is handled if the server header is
"content-type: text/html"?

Not on my server, Apache 1.3.33. Maybe there is a setting
in the Apache config file, I don't know. I guess it may be
different on other servers, but I can't answer that.
2. How do I tell what moe IE6 is using for any given document?

Basically anytime there is a !DOCTYPE at the beginning of a
document, you will be in standards mode.

Maybe someone knows an easier way to tell, but I would do it
buy reading here to be safe:
http://msdn.microsoft.com/library/de...hancements.asp

JL
Jul 21 '05 #27
Justin Lieb wrote:
Lauri Raittila wrote:

You can serve it using text/html, it is bad thing to do, but you can.
Gus Richter wrote:
Can you be specific as to why it is a bad thing?


I have already answered this before:

http://www.hixie.ch/advocacy/xhtml


I have read the document and highly respect Ian Hixie's opinion.

The following section taken from the document probably should have been
at the very beginning:
"(Yes, I said _most_ authors. If you are one of the few authors who
understands how to avoid the issues raised in this document and does
validate all their markup, then this document probably does not
apply to you -- see Appendix B.)"
The gist of the document, as I read it, is the separation of authors
into two categories. The conscientious and the not-so-conscientious with
the hypothesis that most are of the latter type. The document goes on
outlining pitfall scenareos involving the not-so-concsientious as well
as specific problems and how to take care of them.

A second quote in the document that I would like to comment on:
"Sending XHTML 1.1 as text/html is NEVER fine. There is no spec that
allows this."
On the other hand, neither does the spec require the use of
application/xhtml+xml.

So there we have it. Ian and I are in agreement. XHTML served as
text/html is perfectly acceptable, but is _not_ for the
_not-so-conscientious_ and they should stick with HTML or serve up their
documents as application/xhtml+xml, which forces them to be
conscientious, but lose out with legacy browsers.

An item I would like to address as used elsewhere in this thread:
"Tag soup" as used in the document refers to SGML features which are not
supported by browsers and are taken advantage of by Appendix C.
The question, if browsers should support these SGML features, is
actually beside the point. The fact is that browsers don't and members
of the W3C agreed to take advantage of this.

A second item used elsewhere in this thread that I would like to address
is the suggestion that moving to XHTML is not recommended by W3C and
that it is ok to stay with HTML:
XHTML 1.0 does not deprecate HTML since that is not the intent. XHTML
1.0 is a reformulation of HTML 4 which means that HTML 4 is carried
forward, but slightly (or not so slightly depending on your point of
view) modified by, and into, XHTML 1.0 which therefore, and in other
words, replaces/modifies/changes/appends the latest HTML 4.01
recommendation with what is stated in XHTML 1.0.
I quote from XHTML 1.1 which cleanly seperates/removes/deletes:
"... the *deprecated* , legacy functionality of HTML 4 that
was brought forward into the XHTML 1.0 ..."
Whereas HTML 4 itself is not deprecated, the deprecated elements and
attributes are removed in XHTML 1.1.
It is clear to me that HTML 4 has been replaced by XHTML 1.0 and it in
turn has been replaced by XHTML 1.1.

A third and last item, suggested elsewhere in this thread, that I would
like to address is that Appendix C of XHTML 1.0 is not applicable to
XHTML 1.1:
I quote once more from XHTML 1.1:
"This document type [XHTML 1.1] is essentially a reformulation of
XHTML 1.0 Strict ..."
I will not repeat what I said in the second item, immediate above,
except to say that likewise, XHTML 1.0 is brought forward in its
entirety and changed per what is stated in XHTML 1.1.
Perhaps the difficulty is that XHTML recommendations are not completely
separate/self-standing documents as we were used to with HTML 3.2 to 4
to 4.01 and with CSS 1 to CSS 2 to CSS 2.1. With XHTML 1.0 we have to
look at HTML 4.01 *and* XHTML 1.0 and with XHTML 1.1 we have to look at
HTML 4.01, XHTML 1.0 *and* XHTML 1.1. (I know that I am leaving out SGML.)

Pardon me if I may sound like an authority. That is not my intent, and
God knows that I am not. I read and come to conclusions. I really long
to learn, to be corrected if I am wrong, or affirmed in my understanding.

--
Gus

Jul 21 '05 #28
Gus Richter wrote:
<snip>

So there we have it. Ian and I are in agreement. XHTML served as
text/html is perfectly acceptable, but is _not_ for the
_not-so-conscientious_ and they should stick with HTML or serve up their
documents as application/xhtml+xml, which forces them to be
conscientious, but lose out with legacy browsers.

So, are you for or against using XHTML? Please point to the
location in that article where Ian says serving XHTML as
text/html is perfectly acceptable. I gathered that he is
quite against it!

JL
Jul 21 '05 #29
Justin Lieb wrote:
Gus Richter wrote:
> <snip>
>

So there we have it. Ian and I are in agreement. XHTML served as
text/html is perfectly acceptable, but is _not_ for the
_not-so-conscientious_ and they should stick with HTML or serve up
their documents as application/xhtml+xml, which forces them to be
conscientious, but lose out with legacy browsers.

So, are you for or against using XHTML? Please point to the location
in that article where Ian says serving XHTML as text/html is perfectly
acceptable. I gathered that he is quite against it!


I regret that I have not been able to be clearer. Allow me to expand.

You have read Ian's document and have quoted it, but have not understood
it. He is against XHTML because he does not trust authors to be
consciencious in their work. So he advises against serving XHTML up as
text/html because there is no assurance that such authors will produce a
proper document by not validating their document and not properly
applying Appendix C. In fact, he provides scenarios where such authors
are likely to produce improper documents. He advises to either serve the
document up as application/xhtml+xml whereby they will be forced to
create a proper document or to forget about XHTML and stick with HTML.
Since support by IE for application/xhtml+xml is non-existant, he is in
favor of HTML. In his document, he says that if you are a conscientious
author, then his document can be disregarded (since you will assuredly
create a proper XHTML document served up as text/html).

I agree with him that desiring support for legacy browsers, which
includes all IE products, discounts XHTML served up as
application/xhtml+xml at this time. Where he and I part ways is that he
does not trust authors to be trustworthily conscientious in the creation
of XHTML documents and I on the other hand discount this notion and
treat authors alike with the understanding that their XHTML documents
account for all issues raised in Appendix C (and in Ian's document).
What he forgets is that such an untrustworthy type of author will also
likely fail to create a proper document with HTML by not validating
their document, so his solution to assuring a proper document creation
is really no perfect solution.

Ian does not say that serving XHTML up as text/html is illegal, which it
is not. What he does say is exactly what the title of the document says:
"Sending XHTML as text/html Considered Harmful"
<http://www.hixie.ch/advocacy/xhtml>
His opinion as to why text/html should not be used - why he believes
that its use is harmful/unacceptable. On the other hand, he also says
[search for "(yes" in the document] that if the reader of this document
is a conscientious author, then the document does not apply to the
reader. Ergo, for such an author, text/html is *not* harmful, therefore
is perfectly acceptable, as it is legal. In fact, Appendix C.11 suggests
that an XHTML document may be served as text/html.

What he does go on about are reasons (which I have tried to capsulate)
as to why he believes one should not do so. I believe that I am a
conscientious author, as all authors *should* be, and as such, following
his advice, his document does not apply to me, nor *should* it to all
other authors (although the pitfall scenareos and specific problems
outlined are well received and appreciated).

I hope that I have been able to make my position clearer. In a nutshell,
I am *for* XHTML 1.0 served up as text/html at this time (for documents
not using XML tools), only due to lack of support for
application/xhtml+xml by IE. Ian is as well, as I read it, except for
non-conscientious authors for which type he advises HTML. Ian wants to
save the web from faulty new XHTML documents. I believe that his
solution, if followed, will only shift the problem and create faulty new
HTML documents instead.

I repeat as in my previous posting, I am no authority. I long to learn,
to be corrected if I am wrong, or affirmed in my understanding. I
therefore am surprised that I have not been corrected within the last 18
hours since my last posting, so I shall be responding to it with changes.

--
Gus
Jul 21 '05 #30

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
5725
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
3213
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
9496
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,...
1
10110
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
8989
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...
0
6745
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5397
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5534
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4066
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
2
3669
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2894
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.