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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

2 probs with CSS - include and frameset.

Status
Not open for further replies.

JGKWORK

IS-IT--Management
Apr 1, 2003
342
GB

Hi, I'm pretty new to CSS, I was wondering why the following code will work on a page on its own but will not work on a page in a frameset?

<STYLE TYPE-"type/css">

<!--
BODY
{
scrollbar-base-color: white;
scrollbar-arrow-color: blue;
scrollbar-DarkShadow-Color: blue;
}

-->

</STYLE>


Also, I have a client side include file with CSS but this does not work either, can someone tell me why and how to deal with these two issues?

Many thanks.
 
If you added this code to the frameset it won't work since your frameset probably does not have scrollbar. If you want to have different scrollbar on the pages inside the frameset just add this code to those pages. Another thing that could prevent this code to execute is the specification of a doctype since scrollbar control is an IE only thing and is not endorsed by W3C.

I don't know what you mean with the second example, usually when you want to load css from external file you use:

<link rel="stylesheet" type="text/css" href="mystyle.css" />

in the head of the document.
 
Hi and thanks for the reply.

Unfortunately my code is already in the pages within the frameset.

As for the include... I am including a menu using <!--#include virtual="file_name" -->. This include file is just a plain html file with some text. I would like to be able to write the CSS in the include file itself, but it does not work (only works if you write the CSS in the page in which it is being included in).

Thanks
 
I'm sure you know that when you include things you include just the code needed for the include. So if you have a menu in a special table your include file will look like this:

<table>
<tr>
<td>
... Menu
</td>
</tr>
</table>

Since CSS has to be defined in the head of the document -- either as an external <link> or internal <style> you will notice that there is no possiblity to have css in the include file. Since you are including this, you could define the css inline by doing:

<table style="your css;">

but this technique is not recommended. Also, if you have a lot of css for a lot of elements your code will be hard to read. What is wrong with defining css in the head of the document you're including to? Since includes are done server side, when the page is served to the client it is a simple html page. If you have many pages into which you include this menu and was thinking of simplifying the process by having just one css for all of them, you can still do that by referencing external stylesheet via <link> in the head.

As for the scrollbar in a frame, I don't know. Do you have a sample page? I have tested it here and all the frames have custom scrollbars.
 

Thanks for the help Vragabond, makes sense now!

What kind of sample page do you require? i.e. the single page that works, the frameset, the code? I can't give u a link as its an Intranet.

Thanks again.
 
I was hoping to see the page where the scrollbar problems take effect but I understand you can't post a link to the intranet. I was just checking, could be a typo when you were typing the message but your style declaration says:

<STYLE TYPE-"type/css">

I don't think that could be the problem but you might want to change it to:

<STYLE TYPE="type/css">
 

Cheers, tried changing the - to a = but no luck. Weird, this is just a plain html page with CSS which is in a frame (the CSS works on other pages that are not in a frameset).

Ta.
 
1. If you open the page in a new window (not inside the frameset), does it have the proper scrollbar?
2. What are your frameset settings -- could you post them here?

If the page does not have the scrollbar you want when you open it, could you post the code here -- you can omit any classified information.
 
The page who's CSS don't work in a frame but does on its own:

********************

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>We hope the links set up for our Contact Management page will be useful
and user friendly for everyone</title>
<base target="_self">
<STYLE TYPE="type/css">

<!--
BODY
{
scrollbar-base-color: white;
scrollbar-arrow-color: blue;
scrollbar-DarkShadow-Color: blue;
}

-->

</STYLE>
</head>

<body background="../images/main_background.gif" leftmargin="0" rightmargin="0" topmargin="0" vlink="#0000FF" alink="#0000FF">
<table border="0" cellpadding="0" cellspacing="0" width="99%" height="570">
<tr>
<td width="67%" height="570" rowspan="2">
<blockquote>
<p align="left"><font face="Arial" size="2" color="#000080"><br>
<br>
We hope the links set up for our Letter Escalation page will be useful
and user friendly for everyone. To allow you to access our Standard
Responses, please follow the quick and easy guidelines detailed below.</font></p>
<p align="left"><font face="Arial" size="2" color="#000080">How to
access our <b>Standard Responses:-</b></font></p>
</blockquote>
<p align="left">&nbsp;</p>
<blockquote>
<ul>
<li>
<p align="left"><font face="Arial" size="2" color="#000080">Click on
the Standard Responses button above</font></li>
</ul>
<ul>
<li>
<p align="left"><font face="Arial" size="2" color="#000080">Choose a
link from the list on the left of the page</font></li>
</ul>
<ul>
<li>
<p align="left"><font face="Arial" size="2" color="#000080">Click on
the subject required</font></li>
</ul>
<ul>
<li>
<p align="left"><font face="Arial" size="2" color="#000080">Highlight
the paragraph, press Ctrl &amp; C and then Ctrl &amp; V to copy and
paste to your document</font></li>
</ul>
</blockquote>
<p>&nbsp;</td>
<td width="33%" align="center" height="40">
<p align="center">&nbsp;</p>
<p align="center"><br>
<img border="0" src="../images/Office2.png" align="left" width="240" height="135"></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</td>
</tr>
<tr>
<td width="33%" align="center" height="530">&nbsp;
<p align="left"><img border="0" src="../images/Home_Blue.png" width="240" height="135"></td>
</tr>
</table>
<p><font face="Arial" color="#000080"><br>
<br>
</font>
</p>
<div align="center">
<center>
<table border="0" width="86%" cellpadding="0" cellspacing="0">
<tr>
<td width="65%">
<p align="center"><i><font face="Arial" color="#000066" size="1">Are you
satisfied with our Contact Management page, would you like to give us
feedback or suggestions ?<br>
Then <a href="mailto:AllCustomerCareAdminSupport@BSKYB.Com">click here</a>
and give us your thoughts.&nbsp; Thank you for visiting, we welcome your
comments.</font></i></p>
</td>
<td width="35%"></td>
</tr>
</table>
</center>
</div>

</body>

</html>


Ta. (P.S. please ignore any reference to Frontpage I'm taking over from a previous developer!!).
 
I can't believe how close I was and how stupid not to check. The page does not feature changed scrollbar in my IE6, here's the reason:

<STYLE TYPE="type/css">

when I changed it to:

<STYLE TYPE="text/css">

the scrollbar was working ok. I hope this clears out your problem as well.
 

Thanks for the help, but I can't find where the mistake is i.e. <STYLE TYPE="type/css">

could you help?

Ta
 
This is what you have:
Code:
<STYLE TYPE="[b][COLOR=red]type[/color][/b]/css">

This is what it should be:
Code:
<STYLE TYPE="[b][COLOR=red]text[/color][/b]/css">

The type is not "type/css" but "text/css". When I changed that, scrollbar worked in my IE6.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top