Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Apr 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy Centering an image generated by a javascript!

    HI! I'm going INSANE! I just can't figure out this, and I've been stuck in this small detail for days...!

    I want to center with CSS an image generated by a java script!

    I have a contact form in HTML with a CAPTCHA verification, so in the head I include the java script needed to generate the image:

    Code:
    <script type="text/javascript" src="includes/jcap.js"></script>
    Then, in the form I add this cell where the image that is generated by the java script is displayed:

    Code:
    <td colspan="2"><script type="text/javascript">cimg()</script></td>
    So at last, in the java script invoked at the head, it does this to display the image in the HTML:

    Code:
    document.write('<img src="'+imgdir+imgid+'.gif" width=240 height=80 alt="Captcha Image" /></a>');
    So, I have tryed many ways, and I can't seem to find a way to center the imaged generated by the java script... So, any suggestion? Thanks in advanced!

  • #2
    Senior Coder djm0219's Avatar
    Join Date
    Aug 2003
    Location
    Wake Forest, North Carolina
    Posts
    1,294
    Thanks
    4
    Thanked 203 Times in 200 Posts
    Perhaps this will help.

    Code:
    <td colspan="2" style="text-align: center;"><script type="text/javascript">cimg()</script></td>
    Dave .... HostMonster for all of your hosting needs

  • #3
    New to the CF scene
    Join Date
    Apr 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi!

    I found the issue, I had a float:left in the style sheet so the image went to the left all the time, thanks a lot!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •