Forum OpenACS Q&A: CSS in OpenACS

Collapse
Posted by Jim Sims on
I've got my OpenACS site up and running fairly well, thanks to the many contributors to this
board. I'm trying to get Cascading Style Sheets to work. At /webroot I've got two files,
test.htm:

<html>

<head>

  <link rel="stylesheet" href="style.css" type="text/css">

</head>

<body>

  test

</body>

</html>

and style.css in the same directory:

<style type="text/css">

  body { 10%; background: red; }

</style>

When I load test.htm, the style sheet does *not* apply. Yet, if I point my browser directly to
style.css, I can view the file. What am I missing here? I'm neither an OpenACS nor CSS pro, so
I'm trying to reduce this problem to it's essential elements.

Collapse
2: Response to CSS in OpenACS (response to 1)
Posted by Dave Bauer on
Jim, what browser and platform are you testing on? I am not a CSS exper either. What is the 10% for in:
body { 10%; background: red; }
Collapse
3: Response to CSS in OpenACS (response to 1)
Posted by Dave Bauer on
I just noticed something else. You do not need semicolon on the last property (background:red in this case.)
Collapse
4: Response to CSS in OpenACS (response to 1)
Posted by Gilbert Wong on
Take out the style tags in the .css file.  Those are not necessary.  As Dave mentioned, the 10% looks out of place.  Is that a font-size?  Also, the trailing semicolon is ok.
Collapse
5: Response to CSS in OpenACS (response to 1)
Posted by Dave Bauer on
Check out the CSS validator also:

http://jigsaw.w3.org/css-validator/

You can download the validator or use the online validator.

It helped me debug a CSS error that only occured in Opera.

Collapse
6: Response to CSS in OpenACS (response to 1)
Posted by S. Y. on

According to this OpenNSD thread, LINK REL is busted with Netscape 4.7x (Linux) and AOLserver 3.4 - and you can't fix busted browsers.

As mentioned above, you should post your OS/web server/browser poison combination.

Collapse
7: Response to CSS in OpenACS (response to 1)
Posted by Jim Sims on
Cool! Thanks, guys. I removed the <style> tags, the errant '10%;' and the superfluous semicolon, and it works like a charm.