Problem styling a scrollbar inside a frame

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nicky77
    New Member
    • Aug 2007
    • 25

    Problem styling a scrollbar inside a frame

    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

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
    <title>Maguire Advertising Latest news</title>
    <link rel="stylesheet" type="text/css" href="main.css" />
    <style type="text/css">
    body {
    overflow:auto;
    scrollbar-face-color:white;
    scrollbar-highlight-color:#ff9600;
    scrollbar-3dlight-color:#ff9600;
    scrollbar-darkshadow-color:#ff9600;
    scrollbar-shadow-color:white;
    scrollbar-arrow-color: white;
    scrollbar-track-color:#ff9600;
    }
    </style> 
    </head>
    <body>
    <table width="460" border="0" cellpadding="0" cellspacing="0">
      <!--DWLayoutTable-->
      <tr>
        <td width="9" height="20">&nbsp;</td>
        <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>
        <td width="282">&nbsp;</td>
      </tr>
      <tr>
        <td height="5"></td>
        <td></td>
        <td></td>
      </tr>
      <tr>
        <td height="2"></td>
        <td colspan="2" valign="top"><img src="general_images/homepage_images/line_break.gif" alt="Maguire Advertising Line break" width="490" height="2" /></td>
      </tr>
      <tr>
        <td height="19"></td>
    	<td id="news_frame">
       <?
       //get the news stories and print in this frame
       $sql = mysql_query("select * from news order by date desc");
       $numrows = mysql_num_rows($sql);
       
       for ($i=0; $i<$numrows && $i<3; $i++)
       {
       		$row = mysql_fetch_array($sql);
    		$date = $row['date'];
    		$year = substr($date, 0, 4);
    		$month = substr($date, 4, 2);
    		$day = substr($date, 6, 2);
    		echo "<h4 class = 'header'><span class='date_header'>".$day."/".$month."/".$year."</span><br/>";
    		echo $row['title']."</h4>";
    		echo "<p class = 'story'>".$row['story']."</p>";
    		//get any images and wrap text around them
    		$sql2 = mysql_query("select * from Image where news_id = '".$row['id']."'");
    		$numrows2 = mysql_num_rows($sql2);
    		
    		if ($numrows2>0)
    		{
    			$row2 = mysql_fetch_array($sql2);
    			echo "<p><img src = 'news_images/".$row2['url']."' alt = '".$row2['alt']."' title = '".$row2['alt']."' class = 'news_images'></p>";
    		}
       }
       
       ?>
       </td>
      </tr>
    </table>
    </body>
    </html>
  • drhowarddrfine
    Recognized Expert Expert
    • Sep 2006
    • 7434

    #2
    Styling scrollbars is considered bad practice, too.

    Don't know if this affects that but you are missing a closing </frameset> tag.

    Comment

    • drhowarddrfine
      Recognized Expert Expert
      • Sep 2006
      • 7434

      #3
      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.

      Comment

      • Z1P2
        New Member
        • Sep 2007
        • 23

        #4
        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:

        Code:
        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;
        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.

        Comment

        Working...