CSS element in #content

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
Kevin

CSS element in #content

Post by Kevin »

I'm trying to add a bit of css so that when I quote another source I can make that more easy to identify. So I created a stylesheet called blogadd.css which contains the following

Code: Select all

.quote {
   background-color:#cccccc;
   border: dotted
}
That's it, the whole thing. I then went to appearance and options in the Serendipity Administration Suite and added blogadd.css as an External Stylesheet. I can see when I open my blog page that it was added properly as the following line shows up in my html code

Code: Select all

<style type="text/css">@import "blogadd.css";</style>
Finally, I went into a blog entry and added span tags around a section of text like this

Code: Select all

<span class="quote">Don't go breakin my heart</span>
However it just doesn't seem to be working. Any thoughts on what I'm not doing right? Thanks for your help.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: CSS element in #content

Post by garvinhicking »

First off, it seems you're using an outdated version of Serendipity; current versions (>= 0.8) do not have the "external stylesheet" parameters anymore, and instead require you to edit your template's style.css or index.tpl template to add more stylesheets.

However the reason why your stylesheet is not working is hard to tell. You should put the "blogadd.css" file into your core directory and reference the link like "/serendipity/blogadd.css", with full directory paths. Otherwise your browser might not catch it, if you're viewign a file frmo the "archives/" subdirectory. What's your URL?

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Kevin

Post by Kevin »

garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Try to call your css file from the browser:

http://www.kdthompson.com/cblog/blogadd.css

this will give you the error:

Code: Select all

You don't have permission to access /cblog/blogadd.css on this server.

You may need to create an index.html page or enable the directory browsing by creating an .htaccess file containing "Options +Indexes".
That means either blogadd.css does not exist, or its permissions do not allow readability for the webserver. Try to chmod 644 the file.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Kevin

Post by Kevin »

This is kind of a pain. The blog software is what comes from my hosting service, and for the most part it's great, but I have no way of upgrading the software to a newer version. I'll give you an idea of the directory structure that I'm working with.

All of the blog contents are held in a folder called cblog, which is why you have to type /cblog to get to my blog. Inside cblog is the index.php file, and that's also where I've put blogadd.css, that's why I didn't put a full path in place. would it work to list then entire FQDN path (http://www.kdthompson.com/cblog/blogadd.css)?
Kevin

Post by Kevin »

Ooooh, good catch.

I'll look into those permissions and get back with a response.
Kevin

Post by Kevin »

Hey thanks for the help, that took care of my problem. I should have thought to try going directly to the file to see if the permissions were correct.
Post Reply