Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: How to style with CSS?  (Read 5137 times)

0 Members and 1 Guest are viewing this topic.

Ataru

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
How to style with CSS?
« on: November 09, 2007, 07:24:44 pm »

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:

Code: [Select]
<?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:

Code: [Select]
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!
« Last Edit: November 10, 2007, 11:20:09 am by GauGau »
Logged

Nibbler

  • Guest
Re: How to style with CSS?
« Reply #1 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:

Code: [Select]
.mytable img {
      border: 1px solid #000;
      margin: 5px;
}

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

Ataru

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Re: How to style with CSS?
« Reply #2 on: November 10, 2007, 05:08: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:

Code: [Select]
.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!   :)
Logged
Pages: [1]   Go Up
 

Page created in 0.018 seconds with 20 queries.