Welcome Guest, Not a member yet? Register   Sign In
html helper and CSS
#2

[eluser]markup2go[/eluser]
[quote author="john_doe" date="1260240266"]I`m using html helper

Code:
<?php echo img("img/pic1.jpg") ?>

and I want to add a css class. How to achieve that?

I don`t want to use

Code:
$image_properties = array(
          'src' => 'images/picture.jpg',
          'alt' => 'Me, demonstrating how to eat 4 slices of pizza at one time',
          'class' => 'post_images',
          'width' => '200',
          'height' => '200',
          'title' => 'That was quite a night',
          'rel' => 'lightbox',
);

img($image_properties);

is there any trick to add something to my code??

cheers[/quote]

Might be easier to just pass it the associative array directly like:
Code:
img( array('src'=>'img/pic1.jpg', 'class'=>'someClass') );

Can't get much easier than that Wink


Messages In This Thread
html helper and CSS - by El Forum - 12-07-2009, 02:44 PM
html helper and CSS - by El Forum - 12-07-2009, 03:40 PM
html helper and CSS - by El Forum - 12-07-2009, 03:59 PM



Theme © iAndrew 2016 - Forum software by © MyBB