This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Stylesheets > June 2004 > Can CSS handle Include Files?





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Can CSS handle Include Files?
Mario T. Lanza

2004-06-26, 7:15 pm

If you're a web designer, you have undoubtedly used cascading style
sheets in order to improve your sites separation of form and content.
You probably also use Server-side include files to include snippets of
content-building code.

I was thinking, how about adding a reference to an ASP or PHP include
file directly in the style sheet. The new INCLUDE attribute I'm
suggesting would be similar to the BEHAVIOR attribute except that it
would allow reference to a server-side script.

CSS:

..datebox {behaviour:url('getdatepopup.htc')} /* possible */

#sidebar {include:url('myfavoriteblogs.asp')} /* impossible? */

OLD MARKUP:

<div id=sidebar>
<!-- #include file="myfavoriteblogs.asp" -->
</div>

NEW MARKUP:

<div id=sidebar />

Even better if you could include multiple CSS references in display
order:

#sidebar {include:url('latestposts.asp');include:url('myfavoriteblogs.asp')}

Can you imagine how clean your markup would be if this were possible?
Is it possible? Any good techniques?
Stan Brown

2004-06-26, 11:14 pm

"Mario T. Lanza" <mlanza@lycos.com> wrote in
comp.infosystems.www.authoring.stylesheets:
>I was thinking, how about adding a reference to an ASP or PHP include
>file directly in the style sheet. The new INCLUDE attribute I'm
>suggesting would be similar to the BEHAVIOR attribute except that it
>would allow reference to a server-side script.


Why would that need to be new? You include a URL; the Browser
fetches the URL. If that URL happens to be a script, that's the
server's business and the browser doesn't care.

What am I missing?

--
Stan Brown, Oak Road Systems, Cortland County, New York, USA
http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator: http://validator.w3.org/
CSS 2 spec: http://www.w3.org/TR/REC-CSS2/
2.1 changes: http://www.w3.org/TR/CSS21/changes.html
validator: http://jigsaw.w3.org/css-validator/
Wolfgang Wildeblood

2004-06-27, 4:14 am

mlanza@lycos.com (Mario T. Lanza) wrote:

> If you're a web designer, you have undoubtedly used cascading style
> sheets in order to improve your sites separation of form and content.


This would be what politicians call a "motherhood statement"? Why do
some new posters feel the need to do this? Is this one of those
unfriendly newsgroups that doesn't tolerate dissent? Getting to the
point...


> You probably also use Server-side include files to include snippets of
> content-building code.


You didn't mean to imply that the typical website includes only
"snippets of content" buried in a wasteful bloatemplate, I know.


> I was thinking, how about adding a reference to an ASP or PHP include
> file directly in the style sheet. The new INCLUDE attribute I'm
> suggesting would be similar to the BEHAVIOR attribute except that it
> would allow reference to a server-side script.


Since few people understand the wackiness of "behavio(u)r", that's
probably not the best analogy, but yeah.


> CSS:
>
> .datebox {behaviour:url('getdatepopup.htc')} /* possible */


Only in Microsoftland, but yeah.


> #sidebar {include:url('myfavoriteblogs.asp')} /* impossible? */
>
> OLD MARKUP:
>
> <div id=sidebar>
> <!-- #include file="myfavoriteblogs.asp" -->
> </div>
>
> NEW MARKUP:
>
> <div id=sidebar />
>
> Can you imagine how clean your markup would be if this were possible?


Yes. Please update your browser.


> Is it possible? Any good techniques?


The property to include content is called "content", not "include".
Doesn't work in Microsoftland, though.

Download Opera: http://www.opera.com
Read about CSS: http://www.w3.org

--
"I'm sorry, Miss Grant, but you're
going to be sacrificed to a noble end."
Spartanicus

2004-06-27, 4:14 am

mlanza@lycos.com (Mario T. Lanza) wrote:

>If you're a web designer, you have undoubtedly used cascading style
>sheets in order to improve your sites separation of form and content.


Kindly drop the condescending intros.

>I was thinking, how about adding a reference to an ASP or PHP include
>file directly in the style sheet. The new INCLUDE attribute I'm
>suggesting would be similar to the BEHAVIOR attribute


No such thing as "behaviour" in css 2.x, and css has properties and
values, not "attributes".

>CSS:
>
>.datebox {behaviour:url('getdatepopup.htc')} /* possible */
>
>#sidebar {include:url('myfavoriteblogs.asp')} /* impossible? */


CSS is for decoration, not for content. HTML is the correct place to
introduce a "client side include" mechanism. But since this would break
backward compatibility with existing agents, this should only be
attempted in a language that itself is designed to be not backward
compatible.

--
Spartanicus
Mario T. Lanza

2004-06-28, 4:14 am

Thanks for the info.
Roedy Green

2004-06-29, 11:14 pm

On Sun, 27 Jun 2004 08:07:00 +0100, Spartanicus <me@privacy.net> wrote
or quoted :

>
>Kindly drop the condescending intros.


I think he is trying to throw out jellybeans. He is smiling to let
you know he is not one of those newcomers hostile to CSS who come to
troll.


--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews