Search code examples
htmlcssalignment

Image is not aligned right to popup block


Hi,

I have created a popup which has a close button right most to the edge of that popup. I tried to align that image by putting :

position:absolute;
right:0px;
top:0px;

but its not aligning properly..Can any one help.!!!!

Here is my piece of code..

 <!DOCTYPE>
    <html>
     <head>
      <title> New Document </title>     
 <style>      
      div.irmGraphPopup{
        border:10px solid black;
        width:1000px;
        height:500px;
        position:absolute;
       }

      div.irmGraphPopup span:{
        position:absolute;
        right:0px;
        top:0px;
      }
       </style>
     </head>

     <body>
      <div class="irmGraphPopup">
          <span> <img src="round_black_close2.png" alt="Close"/></span>
       </div>

     </body>
    </html>

Solution

  • You have a typo:

    div.irmGraphPopup span{
       position:absolute;
       right:0px;
       top:0px;
    }
    

    Remove the :