...

View Full Version : How do I use two styles in one page?



Pandaemonaeon
03-10-2005, 02:23 AM
I have two scrollbars in a single page (one for a layer, one for the whole document) and I plan on using two different colored scrollbars. How do I do that?

_Aerospace_Eng_
03-10-2005, 02:43 AM
give a class or id to the the element that you want to apply the scrollbar colors to then in the css define the colors under that specific class or element, mind you that scrollbar colors only work in IE/PC and maybe one other browser, and then define the colors for the html element in css

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Scrollbar colors</title>
<style type="text/css">
<!--
html {
scrollbar-3dlight-color : #FFFFFF;
scrollbar-arrow-color : #FFFFFF;
scrollbar-base-color : #000000;
scrollbar-darkshadow-color : #000000;
scrollbar-face-color : #FF0000;
scrollbar-highlight-color : #FFFFFF;
scrollbar-shadow-color : #CCCCCC;
scrollbar-track-color : #000000;
}
div#content {
height:300px;
width:300px;
margin:auto;
overflow:auto;
scrollbar-3dlight-color : #FFFFFF;
scrollbar-arrow-color : #FFFFFF;
scrollbar-base-color : #000000;
scrollbar-darkshadow-color : #000000;
scrollbar-face-color : #0000FF;
scrollbar-highlight-color : #FFFFFF;
scrollbar-shadow-color : #CCCCCC;
scrollbar-track-color : #000000;
}
-->
</style>
</head>

<body>
<div id="content">your text here</div>
</body>
</html>
EDIT:fixed typo thanx jalenack

Jalenack
03-10-2005, 02:48 AM
_Aerospace_Eng_, there is a small but very important typo in your code:

overflow: auto


Generally, its bad form to color a user's scrollbars. This has been discussed many times before at this forum, so do a search on scrollbars and see what you find.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum