View Full Version : A problem with div


goblinryder14
04-25-2004, 05:53 PM
I recently found this script:

<div style="width:300; height:300; overflow:auto;">
BLAHBLAh
</div>

And it could be made to look like an iframe, but i havea few questions...
1)How do i place a bakground on it?
2)How can i make it so that when i hover my mouse on it it changes the background?
3)Can I place to beside directly beside each other without tables?
4)If i can place them directly beside each other...
And there was a dhtml menu in one, and when the menu opened up
(if it was really big) could i get it to open up partially open in
the div beside it?

THanks alot ofr any help

pb&j
04-25-2004, 06:04 PM
1) add this to your STYLE part...
background-color:#000000;
or for an image...
background-image: url(imagename.gif);

2) that would be done with javascript.

3) you can probably add this to your first DIV tag in the STYLE part...
float:left;

4) perhaps. give it a try to find out.

goblinryder14
04-25-2004, 06:07 PM
Wow your really helpfull on this board, this board itsleft is much better than the one i used to go to, htmlhelpcentral.com
BTW THANKS ALLOOOOOOOOOOTTTTTTTT

Calidris
04-26-2004, 09:18 PM
2) that would be done with javascript.
Could do, but it would be cleaner with CSS.

<style type="text/css">
#mydiv { background: blue; }
#mydiv:hover { background: red; }
</style>
<div id="mydiv"></div>Unfortunately, not even the latest version of Internet Explorer supports this natively (even though other browsers have been doing it for ages) so you can only make this work in IE if you use JavaScript. Here's a nifty page that combines the two ideas for the best result:
http://www.xs4all.nl/%7Epeterned/csshover.html