[css-d] link to a style sheet in the body of a page
Hi all, Just wondering if anyone could let me know how to link to an external style sheet in the body of the page, using a method that validates and works for browsers back to Netscape 6, Opera 7, IE 5.0 on PC, IE 5.2 on Mac? Would appreciate your help. Paul __ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d IE7b2 testing hub -- http://css-discuss.incutio.com/?page=IE7 List wiki/FAQ -- http://css-discuss.incutio.com/ Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Re: [css-d] link to a style sheet in the body of a page
Thanks for your reply Ian. I've got a navigation include coming from a third party. They've got their own style sheet for this and it is a part of the include. The include features in the body of the page and it all works OK using the CSS link way, but it doesn't validate. This is because you can't use the link attribute in the body of a document, only in the head. Just wondering if there was another way of linking to the stylesheet in the body of the document: link rel=stylesheet type=text/css media=all href=styles.css/ Any ideas? Cheers - Original Message - From: Ian Young To: Paul Collins Sent: Tuesday, May 09, 2006 12:08 PM Subject: RE: [css-d] link to a style sheet in the body of a page Hi all, Just wondering if anyone could let me know how to link to an external style sheet in the body of the page, using a method that validates and works for browsers back to Netscape 6, Opera 7, IE 5.0 on PC, IE 5.2 on Mac? Would appreciate your help. Paul Not sure what you are trying to do here. Why would you want to link in body rather than head? Ian -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.392 / Virus Database: 268.5.5/334 - Release Date: 08/05/2006 __ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d IE7b2 testing hub -- http://css-discuss.incutio.com/?page=IE7 List wiki/FAQ -- http://css-discuss.incutio.com/ Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Re: [css-d] link to a style sheet in the body of a page
From http://www.w3.org/TR/html4/struct/links.html#edef-LINK This element defines a link. Unlike A, it may only appear in the HEAD section of a document, although it may appear any number of times. Although LINK has no content, it conveys relationship information that may be rendered by user agents in a variety of ways (e.g., a tool-bar with a drop-down menu of links). In other words, you can only link a stylesheet in the head of a document, not the body. Likewise style blocks can only appear in the head element. Paul Collins wrote: Hi all, Just wondering if anyone could let me know how to link to an external style sheet in the body of the page, using a method that validates and works for browsers back to Netscape 6, Opera 7, IE 5.0 on PC, IE 5.2 on Mac? Would appreciate your help. Paul __ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d IE7b2 testing hub -- http://css-discuss.incutio.com/?page=IE7 List wiki/FAQ -- http://css-discuss.incutio.com/ Supported by evolt.org -- http://www.evolt.org/help_support_evolt/ -- Futurate's site for the Their Reading Futures project has been nominated for a prestigious Jodi Mattes accessibility award. This is our second award nomination this year. See: http://www.futurate.com/?p=132 -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.392 / Virus Database: 268.5.5/334 - Release Date: 08/05/2006 __ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d IE7b2 testing hub -- http://css-discuss.incutio.com/?page=IE7 List wiki/FAQ -- http://css-discuss.incutio.com/ Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Re: [css-d] link to a style sheet in the body of a page
Thanks Ian, Yes, it does work with the full URL: it works fine in the body, but doesn't validate. The reason for including it in the body is so I can have a single include come from the third party, being called in the body of the document, which contains all HTML and styles for their nav. This would keep things a little cleaner instead of me adding their style sheet to the header of every single HTML page, as well as their navigation include to the body of the page. Would rather the style sheet was part of their include. Hope that makes sense? Paul - Original Message - From: Ian Young To: Paul Collins Sent: Tuesday, May 09, 2006 12:27 PM Subject: RE: [css-d] link to a style sheet in the body of a page Thanks for your reply Ian. I've got a navigation include coming from a third party. They've got their own style sheet for this and it is a part of the include. The include features in the body of the page and it all works OK using the CSS link way, but it doesn't validate. This is because you can't use the link attribute in the body of a document, only in the head. Just wondering if there was another way of linking to the stylesheet in the body of the document: link rel=stylesheet type=text/css media=all href=styles.css/ Any ideas? Cheers Still needs to be in the head no matter what. However, if you use the complete URL from third part that will work. ie link rel=stylesheet type=text/css media=all href=http://www.clientdomain.com/include/styles.css/ However, I am being totally thick here as I am still not sure what you are trying to achieve. Ian -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.392 / Virus Database: 268.5.5/334 - Release Date: 08/05/2006 __ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d IE7b2 testing hub -- http://css-discuss.incutio.com/?page=IE7 List wiki/FAQ -- http://css-discuss.incutio.com/ Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Re: [css-d] link to a style sheet in the body of a page
On 5/9/06, Paul Collins [EMAIL PROTECTED] wrote: Just wondering if anyone could let me know how to link to an external style sheet in the body of the page, using a method that validates and works for browsers back to Netscape 6, Opera 7, IE 5.0 on PC, IE 5.2 on Mac? Well... as most people have said before, you have to have the link tag in the header, nothing else will validate. But I also see your dilema, after working with many sites with external content. If you are allowed to use javascript on your site, you could use dom to add a new stylesheet from that code-snippet. That should validate and work ;) __ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d IE7b2 testing hub -- http://css-discuss.incutio.com/?page=IE7 List wiki/FAQ -- http://css-discuss.incutio.com/ Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Re: [css-d] link to a style sheet in the body of a page
Paul Collins wrote: The reason for including it in the body is so I can have a single include come from the third party, being called in the body of the document, which contains all HTML and styles for their nav. This would keep things a little cleaner instead of me adding their style sheet to the header of every single HTML page, as well as their navigation include to the body of the page. Would rather the style sheet was part of their include. Can't you just slap their stylesheet on the bottom of your own stylesheet? That way you wouldn't have to include it separately in all your pages. -- Els http://locusmeus.com/ http://locusoptimus.com/ __ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d IE7b2 testing hub -- http://css-discuss.incutio.com/?page=IE7 List wiki/FAQ -- http://css-discuss.incutio.com/ Supported by evolt.org -- http://www.evolt.org/help_support_evolt/