PDA

View Full Version : So... How not to blunt force modify a css?


billybobsky
2006-10-18, 20:56
I am setting up a site built on Joomla! and while I am trying to play with it behind the scenes I wanted to have a non-Joomla! 'we are down' site... Enter my typical blunt force modification: I simply got rid of the php call to the offline css and put in my desired background color using a few lines of html (no, I don't know how to code, but...well written programming languages should and do come as second nature) as I couldn't figure out a way to get the normal css file to produce my desired background....

This (dempirates.com) is my site currently... I want a style sheet that makes the blue background but I haven't been able to figure out how to do this... My modifications to the offline css that is called normally weren't able to produce the results... :/ any help???


Thanks.

Brad
2006-10-18, 21:02
Simply put the CSS code like this:

body { background-color: #000066; }

...in a file named something like "my-awesome-css.css".

Then, in your HTML, include this, preferably between the head tags:

<style type="text/css">
@import "my-awesome-css.css";
</style>

Does that answer your question? (I'm not entirely sure if this is what you were asking.)

billybobsky
2006-10-18, 21:09
I will try that at some point...

I had modified the css to be essentially that but it didn't work... I am not sure why... meh...

I thought I might have been doing something wrong...

Kraetos
2006-10-18, 21:20
I will try that at some point...

I had modified the css to be essentially that but it didn't work... I am not sure why... meh...

I thought I might have been doing something wrong...

Be sure to modify (or maybe you don't even have one) your .htaccess (http://en.wikipedia.org/wiki/.htaccess) file (assuming you are on apache, isn't everyone?) to include a specific 404 error page.

For a 404 page, it's best to put anything external on the page, be it an image, stylesheet, or object. Hitting a 404 in a deep directory can cause weirdness. It's not like you would never NEED to include that stuff on a 404, because you can use an embedded stylesheet.

With a specific 404 and an embedded stylesheet, there should be no problems.

P.S. You're missing your intitial <body> tag, which is causing you to fail validation.