Page 1 of 1

noob - adding style to href

Posted: Wed Mar 31, 2010 2:25 am
by alek3tt
this is one line from script

Code: Select all

$gallery.= "<a href=\"".$directory.$file."\" rel=\"lightbox[".$galname."]\"><img src=\"".$thumbdirectory.$file."\" alt=\"\"></a>\n";

I would like to add style other than a{...} in external css file, so I tought I can add span class but it's not working (syntax error)

Code: Select all

$gallery.= "<span class="thumb_links"><a href=\"".$directory.$file."\" rel=\"lightbox[".$galname."]\"><img src=\"".$thumbdirectory.$file."\" alt=\"\"></a></span>\n";
is there some way to add css class or id to this link?

Re: noob - adding style to href

Posted: Wed Mar 31, 2010 2:27 am
by Benjamin
alek3tt wrote:

Code: Select all

$gallery.= "<span class=\"thumb_links\"><a href=\"".$directory.$file."\" rel=\"lightbox[".$galname."]\"><img src=\"".$thumbdirectory.$file."\" alt=\"\"></a></span>\n";
Since the string is encapsulated using double quotes, you need to escape any double quotes in the string with a backslash.

Re: noob - adding style to href

Posted: Wed Mar 31, 2010 8:16 am
by alek3tt
tnx, it works