PDA

View Full Version : syntax for adding a css style to a perl script please


arpana
11-08-03, 06:16 AM
Hi,
This is my first post and sorry its a no brainer but here goes :)

I have a line in my code that I need to add a style too but I am unsure what the correct way is to do this.

This is my line in perl:

print "<img src=\"/photos/$img\" border=\"0\" alt=\"$img\" id=\"photo\" />";

and I want to add to the begining: <span class="photo"> and at the end: </span>

I tried this but it gave me a 500:

print "<span class="photo"><img src=\"/photos/$img\" border=\"0\" alt=\"$img\" id=\"photo\" /></span>";

Any help greatly appreciated.

Karl

The Hooded
11-08-03, 06:31 AM
What you need todo to fix your error is add the \ backslash character in front of each Quotation mark.

In many programing languages the \ is used as an escape charater to allow for special characters in the code
print "<span class=\"photo\"><img src=\"/photos/$img\" border=\"0\" alt=\"$img\" id=\"photo\" /></span>";