LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] css, php, background colour help (Bluefish as Editor)

[ILUG] css, php, background colour help (Bluefish as Editor)

Conor Mac Aoidh conormacaoidh at gmail.com
Sun Feb 8 10:28:14 GMT 2009


I imagine that it would be something like:

#background :hover{
background:<?php echo $color; ?>;
}

Using the above you would have to create a div inside the body and use  
your CSS powers to make it expand the width/height of the page. You  
could try body :hover but I doubt it would work, it doesn't work on  
tables either.

However if you want the background to have a new color every time you  
put your mouse over you would need to use some javascript because it's  
impossible with PHP without sending another request to the server (as  
far as I know).

Thanks
---
Conor
http://macaoidh.name

On 8 Feb 2009, at 09:42, Frank Murphy <frankly3d at fedoraproject.org>  
wrote:

> Found this on one of those "try this sites"
> http://jeremyjarratt.com/technothrope/component/content/article/37-php/46-simple-php-random-background-color
>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
> <html>
> <head>
> <?php
> $color = dechex(rand(0,15)) . dechex(rand(0,15)) .  
> dechex(rand(0,15)) .
> dechex(rand(0,15)) . dechex(rand(0,15)) . dechex(rand(0,15));
> ?>
> <title>Random color page</title>
> <style type="text/css">
>    body {
>        background-color: #<?php echo $color; ?>;
>        }
> </style>
> </head>
> <body>
>
> </body>
> </html>
>
> -------------
> How can I work this in with css, so that the page(s) background,  
> outside:
> table {table-layout: auto}, would change colour on mouseover,
> without refresh been required.
> Do I need create a colour.php file which is called from css?
>
> I have an idea, just not the knowledge.
>
> Frank
> -- 
> Irish Linux Users' Group mailing list
> About this list : http://mail.linux.ie/mailman/listinfo/ilug
> Who we are : http://www.linux.ie/
> Where we are : http://www.linux.ie/map/



More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


Maintained by the ILUG website team. The aim of Linux.ie is to support and help commercial and private users of Linux in Ireland. You can display ILUG news in your own webpages, read backend information to find out how. Networking services kindly provided by HEAnet, server kindly donated by Dell. Linux is a trademark of Linus Torvalds, used with permission. No penguins were harmed in the production or maintenance of this highly praised website. Looking for the Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!
RSS Version
Powered by Dell