DPChallenge: A Digital Photography Contest You are not logged in. (log in or register
 

DPChallenge Forums >> General Discussion >> css question
Pages:  
Showing posts 1 - 12 of 12, (reverse)
AuthorThread
03/04/2007 09:18:08 PM · #1
Ok, I changed the style of the website I was working on, and it's like THIS now. The sidebar, which is the "News" section, I don't want to edit 6 different pages, save them and transfer them to the server. (this used to be a "links" area, but I have links up top in the tabs). Can I add it to the css stylesheet so when I change it on the stylesheet, it changes it automatically on all the pages?

Here is my code:

/* Sidebar */
#sidebar {
width: 190px;
float: right;
clear: none;
margin-top: 15px;
}

#sidebar h3 {
border-bottom: 1px solid #000;
font-size: 14px;
}

#sidebar ul {
font-size: 12px;
}

#sidebar a, a:visited {
color: #666666;
text-decoration: underline;
}

#sidebar a:hover {
color: #000000;
}


Message edited by author 2007-03-04 21:18:55.
03/04/2007 09:26:09 PM · #2
Sure. Just put that into a file (in this example 'stylesheet.css'), and in the header of each of your pages add this:



Then every page that shares that file will have the same CSS available to it.

If you have multiple different layouts, each page can include more than one stylesheet as well.

03/04/2007 09:32:19 PM · #3
Originally posted by bigalpha:

Ok, I changed the style of the website I was working on, and it's like THIS now. The sidebar, which is the "News" section, I don't want to edit 6 different pages, save them and transfer them to the server. (this used to be a "links" area, but I have links up top in the tabs). Can I add it to the css stylesheet so when I change it on the stylesheet, it changes it automatically on all the pages?


You can style the news section in your style sheet so you don't have to edit the style in 6 different pages but the content can't be included via CSS. You can change your pages to use SSI or PHP and then use includes so you're only editing one page of content.
03/04/2007 09:34:51 PM · #4
Sorry, I wasn't very clear.

I have my stylesheet already, and that's an excerpt from it. Is there something that I can add into that excerpt, a way to change the different quips from the "NEWS" section?

In each page for each section (i.e. index, schedule, etc) There's a list for the quips from the NEWS section.


  • Quip 1

  • Quip 2

  • Quip 3



Can I add that little snippet into the stylesheet?
03/04/2007 09:36:53 PM · #5
No, that's content.
03/04/2007 09:38:01 PM · #6
Originally posted by TechnoShroom:

Originally posted by bigalpha:

Ok, I changed the style of the website I was working on, and it's like THIS now. The sidebar, which is the "News" section, I don't want to edit 6 different pages, save them and transfer them to the server. (this used to be a "links" area, but I have links up top in the tabs). Can I add it to the css stylesheet so when I change it on the stylesheet, it changes it automatically on all the pages?


You can style the news section in your style sheet so you don't have to edit the style in 6 different pages but the content can't be included via CSS. You can change your pages to use SSI or PHP and then use includes so you're only editing one page of content.


Ah dernit. I don't know squat about PHP. Guess I'll just be changing it manually. Thanks, though.
03/04/2007 09:40:30 PM · #7
You don't have a huge site so I would see about using SSI to inject the news. Does your host allow SSI?
03/04/2007 09:44:11 PM · #8
Originally posted by TechnoShroom:

You don't have a huge site so I would see about using SSI to inject the news. Does your host allow SSI?


I have no idea -- the space was donated to me by rainmotorsports. I also do not know squat about SSI. lol.
03/04/2007 09:49:07 PM · #9
It's simple. You just create a page named for example news.htm. In that you would have your snippet...


  • Quip 1

  • Quip 2

  • Quip 3



On the pages you want the snippet to appear you would put this code where you wanted it to appear



If the server is already parsing the files you're done. Wherever you include that code the news.htm file will be inserted into the page. If the server isn't parsing the files you can add the following line to your .htaccess file...

AddHandler server-parsed .html

This will tell the server to parse .html pages.
03/04/2007 11:56:57 PM · #10
I tried that, but it didn't work. I don't have access to the .htaccess file. So, I suppose that won't work. Do you have any other suggestions?
03/05/2007 10:31:33 AM · #11
You could rename the page you want the snippet to appear on with a .shtml extension. That's the standard extension to let the server know you want it parsed. If that doesn't work then SSI isn't enabled and you'd have to have rain enable it for you in the server configuration.
03/06/2007 11:53:26 PM · #12
Originally posted by TechnoShroom:

You could rename the page you want the snippet to appear on with a .shtml extension. That's the standard extension to let the server know you want it parsed. If that doesn't work then SSI isn't enabled and you'd have to have rain enable it for you in the server configuration.


Ah, yes it works! Many thanks.
Pages:  
Current Server Time: 09/18/2025 08:18:35 AM

Please log in or register to post to the forums.


Home - Challenges - Community - League - Photos - Cameras - Lenses - Learn - Help - Terms of Use - Privacy - Top ^
DPChallenge, and website content and design, Copyright © 2001-2025 Challenging Technologies, LLC.
All digital photo copyrights belong to the photographers and may not be used without permission.
Current Server Time: 09/18/2025 08:18:35 AM EDT.