471,610 Members | 1,362 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,610 software developers and data experts.

Problem styling a scrollbar inside a frame

25
Hi, before you say it i know frames are bad practice - but i'm developing dynamic content on a site which has already been designed, so alas there's no option but to use them. Anyway, I just want to add simple styling to the scrollbar of the left hand frame of the page, but the styling i've applied isn't working for some reason.

The site is at http://www.maguiresonline.co.uk/new_website/index.html
It's the scrollbar in the middle of the page which i want to style.

I've added the scrollbar styles to both the <head> of the frameset page, and also the frame source page, code provided below.

Any help would be appreciated - cheers

Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
  5. <title>Maguire Advertising Latest news</title>
  6. <link rel="stylesheet" type="text/css" href="main.css" />
  7. <style type="text/css">
  8. body {
  9. overflow:auto;
  10. scrollbar-face-color:white;
  11. scrollbar-highlight-color:#ff9600;
  12. scrollbar-3dlight-color:#ff9600;
  13. scrollbar-darkshadow-color:#ff9600;
  14. scrollbar-shadow-color:white;
  15. scrollbar-arrow-color: white;
  16. scrollbar-track-color:#ff9600;
  17. }
  18. </style> 
  19. </head>
  20. <body>
  21. <table width="460" border="0" cellpadding="0" cellspacing="0">
  22.   <!--DWLayoutTable-->
  23.   <tr>
  24.     <td width="9" height="20">&nbsp;</td>
  25.     <td width="118" valign="top"><img src="general_images/homepage_images/news_header.jpg" alt="Maguire Advertising latest news header" width="117" height="21" /></td>
  26.     <td width="282">&nbsp;</td>
  27.   </tr>
  28.   <tr>
  29.     <td height="5"></td>
  30.     <td></td>
  31.     <td></td>
  32.   </tr>
  33.   <tr>
  34.     <td height="2"></td>
  35.     <td colspan="2" valign="top"><img src="general_images/homepage_images/line_break.gif" alt="Maguire Advertising Line break" width="490" height="2" /></td>
  36.   </tr>
  37.   <tr>
  38.     <td height="19"></td>
  39.     <td id="news_frame">
  40.    <?
  41.    //get the news stories and print in this frame
  42.    $sql = mysql_query("select * from news order by date desc");
  43.    $numrows = mysql_num_rows($sql);
  44.  
  45.    for ($i=0; $i<$numrows && $i<3; $i++)
  46.    {
  47.            $row = mysql_fetch_array($sql);
  48.         $date = $row['date'];
  49.         $year = substr($date, 0, 4);
  50.         $month = substr($date, 4, 2);
  51.         $day = substr($date, 6, 2);
  52.         echo "<h4 class = 'header'><span class='date_header'>".$day."/".$month."/".$year."</span><br/>";
  53.         echo $row['title']."</h4>";
  54.         echo "<p class = 'story'>".$row['story']."</p>";
  55.         //get any images and wrap text around them
  56.         $sql2 = mysql_query("select * from Image where news_id = '".$row['id']."'");
  57.         $numrows2 = mysql_num_rows($sql2);
  58.  
  59.         if ($numrows2>0)
  60.         {
  61.             $row2 = mysql_fetch_array($sql2);
  62.             echo "<p><img src = 'news_images/".$row2['url']."' alt = '".$row2['alt']."' title = '".$row2['alt']."' class = 'news_images'></p>";
  63.         }
  64.    }
  65.  
  66.    ?>
  67.    </td>
  68.   </tr>
  69. </table>
  70. </body>
  71. </html>
  72.  
Oct 9 '07 #1
3 3058
drhowarddrfine
7,435 Expert 4TB
Styling scrollbars is considered bad practice, too.

Don't know if this affects that but you are missing a closing </frameset> tag.
Oct 9 '07 #2
drhowarddrfine
7,435 Expert 4TB
Also, you are using an 'id' name more than once. id's are to only be used once per page and must be unique to one element.
Oct 9 '07 #3
Z1P2
23
I believe those scrollbars are controlled by the child and not the parent (with the exception of not allowing them via the scrolling="no" command in the parent.

In the child you would put the styling in the body tag, and you could use something like this:

Expand|Select|Wrap|Line Numbers
  1. scrollbar-base-color: #000000; scrollbar-arrow-color: #FFFFFF; scrollbar-3dlight-color: #333333; scrollbar-darkshadow-color: #333333; scrollbar-face-color: #000000; scrollbar-highlight-color: #666666; scrollbar-shadow-color: #666666; scrollbar-track-color: #333333;
  2.  
Hope that helps... by the way, the use of frames is NOT bad practice in and of itself... it's just that there are a lot of people who use them inappropriately, but those people's sites would suck wether they used frames or not.
Oct 10 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by Thomas Buschhardt | last post: by
5 posts views Thread by Z | last post: by
8 posts views Thread by Christopher Benson-Manica | last post: by
2 posts views Thread by anx | last post: by
8 posts views Thread by Dustan | last post: by
1 post views Thread by C D Wood | last post: by
2 posts views Thread by Ray | last post: by
1 post views Thread by dav3 | last post: by
1 post views Thread by XIAOLAOHU | last post: by
reply views Thread by leo001 | last post: by
1 post views Thread by ZEDKYRIE | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.