473,786 Members | 2,765 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
Gus Richter wrote:

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.
Thanks to Michael, I have the missing link of:
<http://www.w3.org/TR/xhtml-media-types/>
which says that text/html for XHTML 1.0 _may_ (optional) be used, and
that text/html for XHTML 1.1 _should not_ be used (not recommended, but
could be used after due considerations and need).
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.
The section below is *way incorrect* and I wish to retract it in its
entirety since nobody has corrected me within the last 18 hours, so
disregard it with my appologies.
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.)
Permit me to restate what I hope is correct:
XHTML 1.0 is the only document which incorporates another, specifically
that of HTML 4.01.
XHTML 1.1 led me astray by the mention of its own Appendix C which I
wrongly took to be that of XHTML 1.0 due to ever presence in mind.
XHTML 1.1 is once again a separate/self-standing document and does *not*
carry forward XHTML 1.0 with its Appendix C, nor HTML 4.01, but uses
Modules to redefine elements and attributes.
I now agree that Appendix C of XHTML 1.0 is not applicable to XHTML 1.1.

Although XHTML 1.1 has the XHTML Legacy Markup Module for legacy browser
support, I fail to find anything regarding empty elements, minimized
tag syntax, or space before the trailing /> (and other XML conforming
and compatibility guidelines), so we are left to apply Appendix C of
XHTML 1.0 on our own, assuming that it also applies to XHTML 1.1? [All
this because of the legacy IE 6/5.5 browsers' popular usage to-date.]

I left the bottom section, since it still applies and gives an excuse.
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.


Hoping for comments and/or corrections,

--
Gus
Jul 21 '05 #31
Gus Richter schrieb:
Justin Lieb wrote:
Gus Richter wrote:
XHTML served as text/html is perfectly acceptable,

With all the ifs and whens, I wouldn't use the word "perfectly" .
[Ian] is against XHTML because he does not trust authors to be
consciencious in their work.
And from my observations he is fucking right about that.
he says that if you are a conscientious author, then his document can be disregarded
Yes, but ...
(since you will assuredly create a proper XHTML document served up as text/html).
.... that's only one option.

The perfectionist creates two (cached) versions on the browser's demand
('Accept'): XHTML 1.1 and HTML 4.01 Strict. (I have sometimes advocated
to combine this with other "advanced" technologies, such as
uncompromised use of Unicode and CSS-P.) At some point he will realize,
though, that just one version yields the least problems (e.g. with
caching) and thus become a realist. If he's not that much of a
perfectionist anyway, he will perhaps choose to use the version in
between the two aforementioned ones, HTML 1.0, then chop that down to
HTML4 tagsoup compatibility (Appendix C), losing in practice the one
real difference between them, well-formedness, but still has the
size-Xtended, readability-reduced code (closing tags are often).
Otherwise he'll choose well-written HTML4.
[i] 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.
He does not forget that. HTML parsers are already tagsoup parsers,
actually ever have been. Current XHTML parsers are way less
error-forgiving, but as long as they are not invoked, there's appearing
more and more mal-formed XML material on the Web. So chances grow that
in a few years a very strict XML parser isn't usable anymore, because,
although it is invoked more often, there's so much legacy pseudo-XML
content, that needs error-tolerant handling, which than will be added in
different ways in different browsers. And history repeats itself. Just
imagine Internet Explorer 7 would accept a/x+x, but put it through a
forgiving parser ... The whole reason for XHTML was lead ad absurdum.

Therefore all XML content should be parsed by XML parsers.

Ian just wants to keep XHTML clean (IMVHUnderstand ing).

If you don't need the X, don't use XHTML!
Ian does not say that serving XHTML up as text/html is illegal, which it
is not.
Note that the inversion is not true, it is not always legal to send
XHTML as text/html. In fact that legality is the exception.

Use text/html for HTML and XHTML 1.0 Appendix C only.
Only use X1C, if you gain any benefit from it---which pretty much nobody
actually does. For those using XML tools in the content generation
process, conversion/output to HTML is in general quite simple (it's for
instance a standard feature of XSLT). Many tools still only output HTML
out of the box, many others only broken XHTML (which is worse).
In fact, Appendix C.11 suggests that an XHTML document may be served as text/html.
Yes, one, and only one, that is adhering to the (informative) rules of
that very appendix (which I wish had never existed, at least not inside
the XHTML1 spec).
I believe that I am a conscientious author,


Too many do believe that about themselves. Life seems simpler that way.
(I'm not doubting your judgment, but don't acknowledge it either.)
Jul 21 '05 #32
Christoph Päper wrote:

Ian just wants to keep XHTML clean (IMVHUnderstand ing).
If you don't need the X, don't use XHTML!
I understand where you and Ian are coming from, but here is the problem;
I wish to conform with W3C guidance and not stagnate with the stagnant
IE thereby allowing it to overrule and dictate. I believe that choosing
the former as the lesser of the two evils.
Use text/html for HTML and XHTML 1.0 Appendix C ...
Agreed.
... only.


Actually, as I mentioned in my other posting:
<http://www.w3.org/TR/xhtml-media-types/>
says that text/html for XHTML 1.1 _should not_ be used (not recommended,
but _could_ be used after due considerations and need).

Although XHTML 1.1 has the XHTML Legacy Markup Module for legacy browser
support, I fail to see how this can be useful without serving the
document up as text/html if such support is desired.

--
Gus
Jul 21 '05 #33
Christoph Päper wrote:
he says that if you are a conscientious author, then his document can
be disregarded


Yes, but ...
(since you will assuredly create a proper XHTML document served up as
text/html).


... that's only one option.

The perfectionist creates two (cached) versions on the browser's demand
('Accept'): XHTML 1.1 and HTML 4.01 Strict.


Danke Christoph,

I have investigated this first option and believe this to be the ideal
solution along with some PHP. With all the negative talk in newsgroups,
I had not realized that there were people that actually covered this
ground and have come up with a working solution.

Now I have more investigation ahead of me and more testing. Thank you
for the prod in the right direction.

--
Gus
Jul 21 '05 #34
> Unless you post a URL, all you'll get are guesses, albeit educated
ones.
Guesses, educated or not, are not what I was after. I posted as my
searching had proven fruitless. If it was a known issue then the replies
would have been thick and fast. I'm trying to fill a gap in my knowledge.

BTW, posting code instead of a URL isn't the same.
The idea of the code was to show there is nothing clever being attempted ie
no hacks, and after a change to the doctype the element lost it's border
and background colour.

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.


I don't expect anyone to write a page...well...a few lines...anyhoo. ..I
posted as I am trying to understand why the change in doctype would do
this, not to get help with the markup. It could be the CMS we are using
which already has a number of quirks and this would be another to add to
the list.
Jul 21 '05 #35

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
9647
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
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,...
0
10363
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10164
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
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
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
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
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.