HighDots Forums  

Re: DOCTYPE / background-image madness!

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss Re: DOCTYPE / background-image madness! in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Els
 
Posts: n/a

Default Re: DOCTYPE / background-image madness! - 07-24-2006 , 03:36 AM






TC wrote:

Quote:
.extlink {
background: url(http://tc2.atspace.com/extlink.gif) no-repeat
right middle;
Make that right center.

Quote:
padding-right: 12px; }
A class=extlink href=zzz>WHATEVER</A
Make that <a class="extlink" href="zzz">WHATEVER</a>

Quote:
I want to open C:\test.htm directly from my hard disk, to see how the
background image looks, before I change my actual website.

Problems:

(1) IE6 only displays the background image if I remove the DOCTYPE
declaration. If I retain that declaration, it does not display that
image, even though it still obeys the other aspects of the 'extlink'
style.
Usually that means that you've done something wrong in the code, which
IE will "forgive" if you have it in Quirksmode, since in Quirksmode it
doesn't "have to" follow the W3C guidelines.

Add the doctype, then *validate your code*, and fix the errors. If
then still IE doesn't show your background, come asking and show an
online example of what it is that's not working.

Quote:
Adding or removing an IE6 "mark of the web" (MOTW) has no affect
on this, one way or the other.
What *is* a mark of the web?

Quote:
(2) FireFox 1.5 does not display the image at all - with or without the
DOCTYPE declaration.
Firefox always wants to follow the W3C recommendations ;-)

Quote:
Questions:

(1) Why does the DOCTYPE stop IE6 displaying the image?
Probably cause your code wasn't good.

Quote:
(2) Why doesn't FF display the image at all?
See above.

Quote:
(3) What should I do to resolve this, to enable local testing of the
files on my hard disk?
Make your code good.

Quote:
I realize that it will probably all work fine, when I copy all of the
relevant files to my web host. But I want to know why it *doesn't* work
fine when I run them locally on my PC. Generally I like to test my
changes locally, before I copy them to my web host.
Good thinking.
However, if you use a file locally and have the href as
file:///C:/blabla, then it will work locally, but not after uploading.
To prevent mishaps like that, you could think of installing a
webserver locally as well. Apache is free :-)

--
Els http://locusmeus.com/


Reply With Quote
  #2  
Old   
TC
 
Posts: n/a

Default Re: DOCTYPE / background-image madness! - 07-24-2006 , 03:53 AM







Els wrote:
Quote:
TC wrote:

Problems:

(1) IE6 only displays the background image if I remove the DOCTYPE
declaration. If I retain that declaration, it does not display that
image, even though it still obeys the other aspects of the 'extlink'
style.

Usually that means that you've done something wrong in the code, which
IE will "forgive" if you have it in Quirksmode, since in Quirksmode it
doesn't "have to" follow the W3C guidelines.

Add the doctype, then *validate your code*, and fix the errors. If
then still IE doesn't show your background, come asking and show an
online example of what it is that's not working.
Yes, good idea to validate first. I'll try that now. But I suspect that
there is no point putting an example online - it will almost certainly
*work* online :-)


Quote:
Adding or removing an IE6 "mark of the web" (MOTW) has no affect
on this, one way or the other.

What *is* a mark of the web?
IE executes local files (C:/blah.test) under the security restrictions
of the Local zone. In days gone by, the Local zone had *less*
restrictions than the Internet zone. So local files were *more capable*
than remote ones. Now days, the Local zone has *more* restrictions than
the Internet zone, so local files are (by default) *less* capable than
remote ones. This gves problems if you want to test your files locally
- they'll have *less* capablity than when you put them on your server!

The MOTW is a special HTML comment which, if included in an HTML file,
says to IE: "execute this file under the security restrictions of the
Internet zone, not the Local zone". This lets you test your files "as
if" they were actually on the web. Despite what many people seem to
think, the MOTW feature is not a security hole, of any descripton.

TC (MVP MSAccess)
http://tc2.atspace.com



Reply With Quote
  #3  
Old   
Els
 
Posts: n/a

Default Re: DOCTYPE / background-image madness! - 07-24-2006 , 04:00 AM



TC wrote:

Quote:
Yes, good idea to validate first. I'll try that now. But I suspect that
there is no point putting an example online - it will almost certainly
*work* online :-)
I don't see why. Really, if the doctype is what makes the difference,
that proves it's not a misplaced image file or anything. So if it
works locally without doctype, and not with a doctype, the same will
be the case on the web.

Quote:
Adding or removing an IE6 "mark of the web" (MOTW) has no affect
on this, one way or the other.

What *is* a mark of the web?

IE executes local files (C:/blah.test) under the security restrictions
of the Local zone. In days gone by, the Local zone had *less*
restrictions than the Internet zone. So local files were *more capable*
than remote ones. Now days, the Local zone has *more* restrictions than
the Internet zone, so local files are (by default) *less* capable than
remote ones. This gves problems if you want to test your files locally
- they'll have *less* capablity than when you put them on your server!

The MOTW is a special HTML comment which, if included in an HTML file,
says to IE: "execute this file under the security restrictions of the
Internet zone, not the Local zone". This lets you test your files "as
if" they were actually on the web. Despite what many people seem to
think, the MOTW feature is not a security hole, of any descripton.
Never heard of it, and never had a problem with HTML files locally,
even if I open them as local files instead of serving them as
webpages. I suppose this only comes into play when using scripts and
stuff, not plain HTML and CSS.

--
Els http://locusmeus.com/


Reply With Quote
  #4  
Old   
TC
 
Posts: n/a

Default Re: DOCTYPE / background-image madness! - 07-24-2006 , 04:01 AM




TC wrote:
Quote:
Els wrote:
TC wrote:

Problems:

(1) IE6 only displays the background image if I remove the DOCTYPE
declaration. If I retain that declaration, it does not display that
image, even though it still obeys the other aspects of the 'extlink'
style.

Usually that means that you've done something wrong in the code, which
IE will "forgive" if you have it in Quirksmode, since in Quirksmode it
doesn't "have to" follow the W3C guidelines.

Add the doctype, then *validate your code*, and fix the errors. If
then still IE doesn't show your background, come asking and show an
online example of what it is that's not working.

Yes, good idea to validate first. I'll try that now. But I suspect that
there is no point putting an example online - it will almost certainly
*work* online :-)
Ok, I just validated my file C:/test.htm at http://validator.w3.org/.
It objected (rather obscurely) to the missing TITLE element. I added
<TITLE>blah</TITLE> to the HEAD element, and now it validates as: "This
Page Is Valid HTML 4.01 Transitional!".

I re-checked what I said in my original post, and it is still the same.
The DOCTYPE element stops the background mage from rendering when I run
the HTML file from my hard disk :-(

Any ideas why?

TIA,
TC (MVP MSAccess)
http://tc2.atspace.com



Reply With Quote
  #5  
Old   
Els
 
Posts: n/a

Default Re: DOCTYPE / background-image madness! - 07-24-2006 , 04:08 AM



TC wrote:

Quote:
Yes, good idea to validate first. I'll try that now. But I suspect that
there is no point putting an example online - it will almost certainly
*work* online :-)

Ok, I just validated my file C:/test.htm at http://validator.w3.org/.
It objected (rather obscurely) to the missing TITLE element. I added
TITLE>blah</TITLE> to the HEAD element, and now it validates as: "This
Page Is Valid HTML 4.01 Transitional!".

I re-checked what I said in my original post, and it is still the same.
The DOCTYPE element stops the background mage from rendering when I run
the HTML file from my hard disk :-(

Any ideas why?
Can you put the example online?

--
Els http://locusmeus.com/
accessible web design: http://locusoptimus.com/


Reply With Quote
  #6  
Old   
TC
 
Posts: n/a

Default Re: DOCTYPE / background-image madness! - 07-24-2006 , 04:10 AM




Els wrote:
Quote:
TC wrote:

Yes, good idea to validate first. I'll try that now. But I suspect that
there is no point putting an example online - it will almost certainly
*work* online :-)

I don't see why. Really, if the doctype is what makes the difference,
that proves it's not a misplaced image file or anything. So if it
works locally without doctype, and not with a doctype, the same will
be the case on the web.
Ok. I could be wrong in that assumption. Now I will actually test it!
If it still goes wrong when run from the web, I'll post an online URL
here.


Quote:
The MOTW is (snip)

Never heard of it, and never had a problem with HTML files locally,
even if I open them as local files instead of serving them as
webpages. I suppose this only comes into play when using scripts and
stuff, not plain HTML and CSS.
Yes, it's only relevant when IE thinks the page has "active content"
(eg. scripts). In theory, the MOTW should just suppress the prompt that
IE issues to ask the user if he wants to run that content. But in
practice, I've found some cases where including an MOTW (to suppress
that prompt), does *not* produce the same effect as excludng it &
replying "yes" to the prompt.

There's lots of usenet comment on "mark of the web" or MOTW.

Cheers,
TC (MVP MSAccess)
http://tc.atspace.com



Reply With Quote
  #7  
Old   
TC
 
Posts: n/a

Default Re: DOCTYPE / background-image madness! - 07-24-2006 , 04:25 AM




Els wrote:

Quote:
Can you put the example online?
Resolved per other post. Thanks for your help :-) Yea usenet!

Cheers,
TC (MVP MSAccess)
http://tc2.atspace.com



Reply With Quote
  #8  
Old   
TC
 
Posts: n/a

Default Re: DOCTYPE / background-image madness! - 07-24-2006 , 04:30 AM




Els wrote:
Quote:
TC wrote:

.extlink {
background: url(http://tc2.atspace.com/extlink.gif) no-repeat
right middle;

Make that right center.
Els, I just realized, that I ignored your suggestion (above) because I
thought (when I read it) that you were just suggesting a cosmetic
change. (Ie. "it would look better centered, instead of where you
currently have it".)

I didn't see that you had noticed that my syntax was wrong. The other
responded said the same thing. But you saw it first! Thanks again,

TC (MVP MSAccess)
http://tc2.atspace.com



Reply With Quote
  #9  
Old   
Harlan Messinger
 
Posts: n/a

Default Re: DOCTYPE / background-image madness! - 07-24-2006 , 10:00 AM



TC wrote:
Quote:
Els wrote:
TC wrote:

Problems:

(1) IE6 only displays the background image if I remove the DOCTYPE
declaration. If I retain that declaration, it does not display that
image, even though it still obeys the other aspects of the 'extlink'
style.
Usually that means that you've done something wrong in the code, which
IE will "forgive" if you have it in Quirksmode, since in Quirksmode it
doesn't "have to" follow the W3C guidelines.

Add the doctype, then *validate your code*, and fix the errors. If
then still IE doesn't show your background, come asking and show an
online example of what it is that's not working.

Yes, good idea to validate first. I'll try that now. But I suspect that
there is no point putting an example online - it will almost certainly
*work* online :-)


Adding or removing an IE6 "mark of the web" (MOTW) has no affect
on this, one way or the other.
What *is* a mark of the web?

IE executes local files (C:/blah.test) under the security restrictions
of the Local zone.
When I load a on my hard drive into IE as a file without using http, the
security level indicator shows "My Computer", not Local zone.

Quote:
In days gone by, the Local zone had *less*
restrictions than the Internet zone. So local files were *more capable*
than remote ones. Now days, the Local zone has *more* restrictions than
the Internet zone, so local files are (by default) *less* capable than
remote ones.
Oh? I've observed the opposite, and this would make no sense, the whole
point being that you trust your own resources more than you trust other
people's.

I think you may be misinterpreting the situation. The current security
level is based on the page currently in your browser. If the page in
your browser is external, a higher security level applies. A *link* is
subject to fewer restrictions (if any at all) than a *link* to a local
file, the whole point being that if an external page is trying to get
you to click a link to your own files, it might be because it's trying
to cause trouble.


Reply With Quote
  #10  
Old   
Ed Mullen
 
Posts: n/a

Default Re: DOCTYPE / background-image madness! - 07-24-2006 , 10:34 AM



Els wrote:

Quote:
What *is* a mark of the web?

http://msdn.microsoft.com/workshop/a...rview/motw.asp

--
Ed Mullen
http://edmullen.net
http://mozilla.edmullen.net
http://abington.edmullen.net
Deja Goo: The feeling that you've stepped in this before.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.