CSS - A formal quickie!

They have: 344 posts

Joined: Jun 2002

Hi guys!

I just want to know whether it would be possible for me to put this code in CSS. Yes or No?

<table width="560" cellspacing="0" cellpadding="0" bgcolor="#ffffff" align="center">
<tr>
<td>
<table width="560" height="79" valign="top" align="center" cellspacing="0" cellpadding="0">
<tr width="560" height="79" valign="top" align="center">
<td width="560" height="79" valign="top" align="center">
<a href="/"><img src="/images/banner.gif" border="0"></a>
</td>
</tr>
</table>
<table width="560" valign="top" align="center" cellspacing="5" cellpadding="0">
<tr width="560" valign="top">
<td width="560" valign="top" bgcolor="#E6E6E6">
&nbsp;&nbsp;
&lt;script language="javascript"&gt;
<!--
Today = new Date();
TodayDay = Today.getDate();
TodayMon = Today.getMonth();
TodayYear = Today.getYear();
if (TodayYear < 2000) TodayYear += 1900;
if (TodayMon == 0) { TodayMonth = "January"; }
else if (TodayMon == 1) { TodayMonth = "February"; }
else if (TodayMon == 2) { TodayMonth = "March"; }
else if (TodayMon == 3) { TodayMonth = "April"; }
else if (TodayMon == 4) { TodayMonth = "May"; }
else if (TodayMon == 5) { TodayMonth = "June"; }
else if (TodayMon == 6) { TodayMonth = "July"; }
else if (TodayMon == 7) { TodayMonth = "August"; }
else if (TodayMon == 8) { TodayMonth = "September"; }
else if (TodayMon == 9) { TodayMonth = "October"; }
else if (TodayMon == 10) { TodayMonth = "November"; }
else if (TodayMon == 11) { TodayMonth = "December"; }
else { TodayMonth = TodayMon; }
document.write(TodayMonth + " " + TodayDay + ", " + TodayYear);
-->
&lt;/script&gt;
- Welcome to <a href="http://cmdirector.neosurge.net/index.php"><font color="#000099">CM Director.</font></a>  Check out our forums:  <a href="http://www.cmdirector.neosurge.net/board/"><font color="#000099">The Forums</font></a>
</td>
</tr>
</table>
<table width="560" valign="top" align="center" cellspacing="0" cellpadding="5">
<tr width="560" valign="top">
<td width="130" valign="top" align="center">
<!-- insert nav here -->

<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/
shockwave/cabs/flash/swflash.cab#version=4,0,2,0" width="129" height="169">
<PARAM name="movie" value="/includes/Soccer.swf">
<PARAM name="quality" value="high">
<PARAM name="menu" value="true">
<EMBED src="/includes/Soccer.swf" quality="high" menu="true" pluginspage="http://www.macromedia.com/shockwave/
download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="129" height="169">
</EMBED>
</OBJECT>

</td>
'

This is the design element for this page:

http://www.cmdirector.neosurge.net/articles.shtml

The Webmistress's picture

She has: 5,586 posts

Joined: Feb 2001

Sorry, you've lost me. What exactly are you trying to put within the CSS?

They have: 344 posts

Joined: Jun 2002

I just want to put the design aspect of that page, the code above, into and external CSS sheet so that I don't have to have that code on every page. Is it possible for me to do this?

Busy's picture

He has: 6,151 posts

Joined: May 2001

you want to use SSI, PHP, Javascript even. CSS files are for CSS only

Renegade's picture

He has: 3,022 posts

Joined: Oct 2002

Quote: Originally posted by The Webmistress
Sorry, you've lost me. What exactly are you trying to put within the CSS?

Yeah i'm lost to :S

But I think what your trying to do is impossible,

They have: 344 posts

Joined: Jun 2002

What? Produce a file where i just link one page to this file and then I can change the design from that one file except having to go through every one?

The Webmistress's picture

She has: 5,586 posts

Joined: Feb 2001

Yes, have a look on google for SSI (server side includes) tutorials and check with your hosts that they allow this.

They have: 344 posts

Joined: Jun 2002

I was told that SSI is for site content and CSS is for design? Is this true or can they both be used for either? Do you advise me to just put the link and leave it as HTML or create a new css file or is that not possible?

Busy's picture

He has: 6,151 posts

Joined: May 2001

SSI is "server side includes", which includes from server side
CSS is decoration, text, links, divs section etc (no tables or html bits) "cascading style sheets"

You want to combine the two, you can't. You can include a seperate .css file for color, style etc, but not to hold any html tags

page title
-- include style sheet with .css --
-- can also include javascript file .js - optional --

-- include layout or sections of layout like header with SSI --
content
-- include more layout or footer etc with SSI --

They have: 344 posts

Joined: Jun 2002

Would it work if I copy the navigation elements into an SSI page and link to that?

Busy's picture

He has: 6,151 posts

Joined: May 2001

As The Webmistress mentioned further back, do a search for SSI, find out what it is and what it does, I could tell you yes or no but you wont know how to fix it if anything doesnt work properly.
read the bottom line of my signature

They have: 344 posts

Joined: Jun 2002

Right! I really like that quote! Who said that really? I have done a search for SSI and I do now know what it is thanks to Webmasterbase. I also know what it does so you can tell me yes or no now! Wink

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

If you know what it does... Oh, nevermind.

SSI -- you can put pieces of files into one large file (php, asp, jsp includes work the same way, different syntax)

CSS -- ONLY CSS (dammit)! This is an entire file that is included and PARSED (interpreted) by the browser and then applied to the HTML content. In a way, it's like a skin that's put on top of the HTML skeleton. The skeleton can be put together in many pieces (using includes) or be whole in the first place, it doesn't matter to the CSS. The CSS is put on last.

They have: 344 posts

Joined: Jun 2002

Ok...I have had a go at this and I get:

[an error occurs while processing this directive]

You can see this on the page below:

http://cmdirector.neosurge.net/cm0102/reviews.shtml

I have checked the relevent SSI pages and they are online and look ok. This is the code I have used. I can only guess it is the wrong one:

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

is your url there? Can you browse to the file you're calling in the include?

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

There are two ways of including files. It's been a while since I've used SSI, but one is include virtual="" and the other is include file="" and they require different paths, if I recall.

They have: 344 posts

Joined: Jun 2002

Really? So they cannot be in the same folder? Aah well. I will try your second method.

They have: 344 posts

Joined: Jun 2002

Right I have fixed it. The first error was that the code should be:

So the file had to be put in an includes folder and then it works. Thanks for helping though. It was you that made me fix it because I went to my source of info, Webmasterbase, and read that the file must be in includes. So thanks! Smiling

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

Timewell, you need to work on your comprehension! Those are two METHODS. The reason what you read works is because one of the METHODS works for you. i.e. linking to the file relative to root, virtual (instead of file).

They have: 344 posts

Joined: Jun 2002

Sorry! I apologise! Can you remind me how you put SSI into php please? I did it for my first page and tried for another but it wouldn't work for some reason...Confused

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

SSI and PHP are different server-side languages. Did you want to post this in Server Side Scripting?

Renegade's picture

He has: 3,022 posts

Joined: Oct 2002

lol a formal quickie has turned into such a long thread Sticking out tongue yeh you need to post in the server side scripting forum Smiling

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.