RE: How can you set a mouse-over image change in PHP?

paulm2003 <[email protected]> 13 Sep 2003 15:55:43 -0000
Newsgroups gmane.comp.web.oscommerce.general
Message-ID <7d4af71bd35d844bf51daf3d022a8d27@osCommerce-Forums>
This message was sent from: General Support
http://forums.oscommerce.com/viewtopic.php?p=228910#228910
----------------------------------------------------------------

[quote="CLKeenan"]How would I go about formatting that in the .css sheet?[/quote] Just open catalog/stylesheet.css in a text editor, add the code anywhere you want, save and upload.

You can also add a comment line like this[code]/* new styles added by CLKeenan */[/code]

But the difficult part is to add this style only to the images you want

if you add:[code]img {border: 4px #09f groove;} [/code]to the stylesheet every image gets these borders (unless an other style is assigned to it)


if you want to add these styles to some images you can add:[code]img.classname  {border: 4px #09f groove;}[/code]to the stylesheet.css

and:[code]<img class="classname" src="images/niceImage.jpg" >[/code]in the html/php page


if you want to add this a style to one image, add:[code]img#uniqueidname  {border: 4px #09f groove;}[/code]to the stylesheet.css

and:[code]<img id="uniqueidname" src="images/niceImage.jpg" >[/code]in the html/php page


"classname" and "uniqueid" are examples you can choose the names youself, something easy to remember/logical.


To get an impresion what borders are available with CSS you can take a look at http://artlung.com/lab/css/border-style/ 

It is also possible to ad these classes and or id's to the table cells <td> for example. Or to any other HTML element.

Paul