How to style with CSS? How to style with CSS?
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

How to style with CSS?

Started by Ataru, November 09, 2007, 07:24:44 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Ataru

Hello,
Just wondering how I might go about styling my pics with CSS.  I've tried placing the following code inside a table that was styled so that images would have a 1px solid black border with a 5px margin, but no luck:

<?php
$objCpm 
= new cpm("./images/cpmfetch/cpmfetch_config.php");
$objCpm->cpm_viewLastAddedMedia(1,5);
$objCpm->cpm_close();
?>


I've looked through the code and I think I need to set up a CSS stylesheet that somehow links to the following code in cpmfetch.php:

function cpm_viewLastAddedMedia($rows, $columns, $options="") {
$this->loadOptions($options);
//$resultset = $this->getLastAddedMedia($rows*$columns);
$resultset = $this->getLastAddedMediaFrom("",$rows*$columns);
$this->addDescriptionsToResultSet($resultset);
$retval = "";
switch ($this->returntype) {
case ('resultset'):
$retval = $resultset;
break;
case ('html'):
$retval = $this->createTable($resultset,$rows,$columns);
break;
case ('print'):
default:
print $this->createTable($resultset,$rows,$columns);
}

$this->clearOptions();
return ($retval);
}


But I'm not sure how to go about that, so could I get some help?
Thanks!

Nibbler

CSS does not 'link' to PHP code.

If you gave the table a class of mytable then your CSS would be as follows:


.mytable img {
      border: 1px solid #000;
      margin: 5px;
}


Posting a link to your site is almost mandatory for questions such as yours.

Ataru

Quote from: Nibbler on November 09, 2007, 08:44:02 PM
CSS does not 'link' to PHP code.

If you gave the table a class of mytable then your CSS would be as follows:


.mytable img {
      border: 1px solid #000;
      margin: 5px;
}


Posting a link to your site is almost mandatory for questions such as yours.

*ehem*   :-[  Oops.  That would explain it.  I was using:

.mytable image {
      border: 1px solid #000;
      margin: 5px;
}

And I had only set the <td> to the mytable (or in my case, latest_images) class.

The link to my site:  http://www.creaturefeature.info
There you can see cpmfetch working perfectly.  Thanks!   :)