Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New Coder
    Join Date
    Aug 2007
    Posts
    93
    Thanks
    9
    Thanked 0 Times in 0 Posts

    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. I've searched through the forum and the net and i can't see what i'm doing wrong...

    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>

  • #2
    Senior Coder BarrMan's Avatar
    Join Date
    Feb 2005
    Location
    Israel.
    Posts
    1,644
    Thanks
    69
    Thanked 83 Times in 82 Posts
    Code:
    body {
    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;
    }
    You don't have a body tag there.
    try using:
    Code:
    frame {
    ...
    ...
    }

  • #3
    New Coder
    Join Date
    Aug 2007
    Posts
    93
    Thanks
    9
    Thanked 0 Times in 0 Posts
    Thanks for the reply barrman - i've tried using the frame tag as suggested, but still no luck i'm afraid...any other suggestions?

  • #4
    Senior Coder BarrMan's Avatar
    Join Date
    Feb 2005
    Location
    Israel.
    Posts
    1,644
    Thanks
    69
    Thanked 83 Times in 82 Posts
    Yes, instead of defining the scrollbar's properties in the frameset page, try defining it on the actual frame page.

  • #5
    New Coder
    Join Date
    Aug 2007
    Posts
    93
    Thanks
    9
    Thanked 0 Times in 0 Posts
    yeah i already have the scrollbar defined on the source page (see the code on my first post) - also tried applying scrollbar properties to a <div> within the body but no joy there either. now at a loss with this one!

  • #6
    Senior Coder BarrMan's Avatar
    Join Date
    Feb 2005
    Location
    Israel.
    Posts
    1,644
    Thanks
    69
    Thanked 83 Times in 82 Posts
    If you're using FF you can't style your scrollbars. Only IE has such permission for the broswer.

    If in IE it doesn't work either, try using the IDs of the frames to give them the styles.
    Last edited by BarrMan; 10-09-2007 at 01:00 PM.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •