By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,278 Members | 1,342 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,278 IT Pros & Developers. It's quick & easy.

css problem

P: n/a
Sorry to ask here, but can't find any CSS NG with more than 10 threads.

On my site they are various article to sell from various companies.

The companies update the database directly on my server.

Now, some companies would like to "integrate" their articles also on their
website.

For this, we are doing the job to have their articles coming from our site
in a frame.

BUT !!! when we try to apply a CSS on the frame, we have a big problem:
nothing appens.

We'd like the customers to manage their own CSS, instead of asking us to
change for them.

<link href="test.css" rel="stylesheet" type="text/css">
<title>No title</title>
</head>
<frameset cols="80,*" frameborder="NO" border="0" framespacing="0">
<frame src="leftmenu.htm" name="leftFrame" scrolling="NO" noresize>
<frame src=www.mysite.com name="mainFrame">
</frameset>

we'd like www.mysite.com to takes the test.css.

How to do so? Our client don't have access to scripts (no php, no asp...)

Bob
Jul 17 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
I noticed that Message-ID: <42**********************@news.sunrise.ch>
from Bob Bedford contained the following:
BUT !!! when we try to apply a CSS on the frame, we have a big problem:
nothing appens.

Of course. The CSS will only apply to the frameset, not the pages that
make up the frameset.

Can you not add the location of the client's CSS file to your database
and add it to www.mysite.com before it is sent out?
--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Jul 17 '05 #2

P: n/a
Could you not apply a CSS to a frame via javascript? Each window has a
name that is allows it to be identified in JavaScript and there are
ways to apply Class changes via JavaScript. I don't mean to lead you
down the wrong path, but I would suggest taking 15 minutes to google
"CSS frames javascript".

-CF

Jul 17 '05 #3

P: n/a
NC
Bob Bedford wrote:

We'd like the customers to manage their own CSS, instead of asking
us to change for them.

<link href="test.css" rel="stylesheet" type="text/css">
<title>No title</title>
</head>
<frameset cols="80,*" frameborder="NO" border="0" framespacing="0">
<frame src="leftmenu.htm" name="leftFrame" scrolling="NO" noresize>
<frame src=www.mysite.com name="mainFrame">
</frameset>

we'd like www.mysite.com to takes the test.css.

How to do so?


You have at least three options:

1. The customer's Web site communicates location of its CSS file
to your site transparently:

<link href="test.css" rel="stylesheet" type="text/css">
<frameset cols="80,*" frameborder="NO" border="0" framespacing="0">
<frame src="leftmenu.htm" name="leftFrame" scrolling="NO"
noresize>
<frame src="http://www.mysite.com/?css=[url]" name="mainFrame">
</frameset>

where [url] is the full URL to the style sheet.

Then your script simply does the following:

echo '<link href="', $_GET['css'],
'" rel="stylesheet" type="text/css">';

The advantage is that is is transparent. The disadvantage is
that the [url] will have to be in URL encoding, rather than
raw, which tends to confuse the less technically adept...

2. The customer's Web site communicates location of its CSS file
to your site via a customer identification code of some kind:

<link href="test.css" rel="stylesheet" type="text/css">
<frameset cols="80,*" frameborder="NO" border="0" framespacing="0">
<frame src="leftmenu.htm" name="leftFrame" scrolling="NO"
noresize>
<frame src="http://www.mysite.com/?cid=234" name="mainFrame">
</frameset>

Then your script can pull a location of the CSS file for
customer number 234 from a database or a text file.

The advantage is ease of use for your client. The disadvantage
is that you need to keep a database of CURRENT URLs to customers'
style sheetes.

3. Your site should know URLs to customer's CSS files and include
them accordingly, depending on who's calling the site. For
example, you can do this:

$parts = parse_url($_SERVER['HTTP_REFERER']);

and then output the link to the style sheet based on
$parts['host'].

In all cases, these options are only good for initial detection.
To keep the style sheet setting, you will need to propagate it
via a CGI variable or a session variable.

Cheers,
NC

Jul 17 '05 #4

P: n/a
.oO(Bob Bedford)
Sorry to ask here, but can't find any CSS NG with more than 10 threads.


<news:comp.infosystems.www.authoring.stylesheets >

Micha
Jul 17 '05 #5

P: n/a
"ChronoFish" <de**@chronofish.com> a écrit dans le message de news:
11**********************@g14g2000cwa.googlegroups. com...
Could you not apply a CSS to a frame via javascript? Each window has a
name that is allows it to be identified in JavaScript and there are
ways to apply Class changes via JavaScript. I don't mean to lead you
down the wrong path, but I would suggest taking 15 minutes to google
"CSS frames javascript".


Javascript isn't suitable as many user still desactivate it !
Jul 17 '05 #6

P: n/a

"Michael Fesser" <ne*****@gmx.net> a écrit dans le message de news:
ph********************************@4ax.com...
.oO(Bob Bedford)
Sorry to ask here, but can't find any CSS NG with more than 10 threads.


<news:comp.infosystems.www.authoring.stylesheets >


I meant on my ISP's NG list. Thanks anyway.
Jul 17 '05 #7

P: n/a
.oO(Bob Bedford)
<news:comp.infosystems.www.authoring.stylesheets >


I meant on my ISP's NG list. Thanks anyway.


Ask them to get that group or find a better newsserver.

Micha
Jul 17 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.