Tuesday, March 1, 2011

Align an image where the source is set by javascript

Hi- I'm putting the network solutions 'seal' image on my site and they give you a javascript that sets the image. I'm wanting the image to align>right. However, if you want the image, they give you a javascript code stub and it handles the rest, which has no alignment property. I've even tried putting the javascript into a table that aligns right but apparently the javascript is rendered after the table is rendered by the browser.

Thoughts on how to get around this?

From stackoverflow
  • You could wrap the JavaScript code area with a div and give it a class or id. Then you can most likely target it with CSS.

    <div id="network-solutions">
        <script type="text/javascript" src="foo.js"></script>
    </div>
    
    
    #network-solutions img {
        float:right;
    }
    
    Mike Robinson : Might want to do a span, the div is a block element
    asp316 : PERFECT! Thank you!

0 comments:

Post a Comment