Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CSS and SSI 1

Status
Not open for further replies.

Snaggs

Programmer
Jan 11, 2000
393
0
0
US
OK,

I have a header.asp, footer.asp and default.asp

header looks like this:
<head>
<link href=&quot;style1.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot;>
<title>Test Site</title>
</head>
<body>
</table>
<table border=&quot;1&quot; cellspacing=&quot;1&quot; cellpadding=&quot;1&quot; width=&quot;100%&quot;>
<tr class=&quot;mainmenu&quot;>
<td>Home</td>
<td>Gallery</td>
<td>Events</td>
<td>Directions</td>
<td><A href=&quot;members.asp&quot;>Members Area</A></td>
</tr>
</table>
</table>
<br>
no closing body or html, it appears in the footer.asp

footer.asp looks like this:
</body>
</html>

default.asp looks like this:
<!-- #include file=&quot;header.asp&quot; -->
<table class=&quot;mainmenu&quot;>
<tr><td>This is a test</td></tr>
</table>
<!-- #include file=&quot;footer.asp&quot; -->

style1.css looks like this:
<STYLE>
BODY
{
}
.mainmenu
{
COLOR: ivory;
BACKGROUND-COLOR: dodgerblue
}
</STYLE>

My issue is this... The mainmenu class for the menu in the header works fine and the colors I set in the style1.css file show up correctly in the header.

However, the SAME mainmenu class in the default.asp file does not color the table like it did in the header.asp.

SSI = Server Side Include

------------
Header <-- Color works here (SSI page)
------------
Default <-- Color does not work here (Loaded page)
------------
Footer <-- Have not tested color here (SSI page)
------------

Default has no reference to the style1.css page, except for the fact that default.asp does a server side include of header.asp.

So now for my question. Are CSS references and classes preserved across pages that use server side includes?

I'm using IIS 5.0 on Windows 2000 Server. Snaggs
tribesaddict@swbell.net
Life can only be understood backwards; but it must be lived forwards.
 
why you have to put 2 included file ??
if you want your header and footer to be appeared in every page . then why don't you use template which you can include in every page you develop.
and using full-attached css style sheet for your header & footer.

any way.. your case is never thought before.

regards,
JJ26
 
jj26,

Thanks for the response, can you give me a good example of the template you're talking about? If you have an existing one or you'd like to put one together as an example I'd very much appreaciate it. You can post it here or if it's too big you can send it to me at snaggs34@hotmail.com

Thanks, Snaggs
tribesaddict@swbell.net
Life can only be understood backwards; but it must be lived forwards.
 
If you're using Macromedia MX, it offers u a facility to make templates.
I try to make u one which i send to ur email.

hope it helps


Regards,
JJ26
 
Hi Snaggs - what browser do you use? Different browsers have different requirements as to how you apply your styles so it is best to be as strict as possible so that it works across all. In the header.asp file you apply your style to the row as follows:
Code:
<tr class=&quot;mainmenu&quot;>
and in the main file you apply the style to the table as follows:
Code:
<table class=&quot;mainmenu&quot;>
This will work fine in some browsers but not in others. To be on the safe side you should apply the style to each table cell as follows:
Code:
<table>
 <tr>
  <td class=&quot;mainmenu&quot;>This is a test</td>
 </tr>
</table>
I'm not sure this is your problem but it's worth trying anyway! i love chocolate
 
emblewembl,

Thanks for the response. I've tried moving it all different places in the table format. It just happened to be in that location when I made the post. Good observation though.

I even tried putting Response.Buffer=True so it would build the page before sending it, but it didn't help.

Thanks for any additional information you might provide.
Snaggs
tribesaddict@swbell.net
Life can only be understood backwards; but it must be lived forwards.
 
Snaggs could you email me the files involved so I can test on my system and see if I can fix it for you? My email address is echristy@intracite.com

i love chocolate
 
emblewembl,

Thanks for looking at the files. For some reason my server was caching the pages so the changes to the CSS weren't taking effect. I rebooted the server and now all is fine.

Thanks again,
Snaggs
tribesaddict@swbell.net
Life can only be understood backwards; but it must be lived forwards.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top