Blending Code Sections Together

<a href="large-image.jpg" class="highslide" onclick="return hs.expand(this)">
    <img src="thumbnail.jpg" alt="Highslide JS"
        title="Click to enlarge" height="100" width="100" />
</a>
<img class="right" img src="tut_page/tutorials/ramen/demo.jpg" alt="Highslide JS" title="Click to enlarge" height="100" width="100"/> 

I would like to enclose the code above into the code below. What I have done so far is it in the right direction ? I don’t know where to place the anchor and the class because there is already a class and a anchor in the lines below.

Thank you victor for your help.

the img element is an empty element. that means it has no content.

starting from that, you cannot enclose the code above (<a>) in the code below (<img>). for that you would need a start tag (that you have) and an end tag (that you don’t have) for the image element, and in between them the content (pretty much like how in the code above, the <img> is part of the <a>; but <a> is an element that has a start tag and an end tag, which makes him capable of holding content, inline content to be more exact).

I’m guessing you’re aiming for this, and want to apply the class “right” in addition to “highslide”, presumably (based on the [URL=“http://www.thecreativesheep.ca/tut_page/tutorialpage.htm”]page linked in [URL=“http://www.sitepoint.com/forums/showthread.php?t=702332”]previous query) to float it to the right.

You’ll be pleased to learn that multiple classes can be assigned to elements.

Add the class “right” to the anchor:

<a href="large-image.jpg" class="highslide right" onclick="return hs.expand(this)"><img src="thumbnail.jpg" alt="Highslide JS" title="Click to enlarge" height="100" width="100" /></a>

Ensure that the anchor’s href attribute points to the large image and the img’s src to the thumbnail.

If this doesn’t do what you want, style wise, you could add a wrapper to each thumbnail link, as in the examples at the Highslide site, or add specific CSS for a.right.

Knowing exactly what end result you are seeking would help.