Search code examples
htmlcssimageidentify

html and css identifying elements


How can I use CSS and html to place a picture on the left and right with the div tag? Or is there a better way? For instance I have:

HTML:

<img src ="..." .... ... />     <!--Picture 1-->
<img src = "..." .... .... />       <!--Picture 2-->

CSS:

img
{
align:left
}

This will align both images to the left. How can I "identify" both image elements and then align one left, and the other right. Both images are aligned with respect to a centered java applet.


Solution

  • you can identify with "class" tags

    <img src ="..." class="img1" />     <!--Picture 1-->
    <img src = "..."class="img2" />       <!--Picture 2-->
    
    .img1
    {
    ...
    }
    
    .img2
    {
     ...
    }