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 6 of 6
  1. #1
    Regular Coder
    Join Date
    Jul 2003
    Location
    NJ - #29 if you must know
    Posts
    117
    Thanks
    0
    Thanked 0 Times in 0 Posts

    <DIV..> is breaking my line

    Take the two scripts..

    <TD WIDTH=10% ALIGN="LEFT">
    <BUTTON OnClick="seladdr('1');" ALIGN="LEFT"><IMG SRC="/arrow.gif" width=17 height=13></BUTTON>
    <DIV ID="ALABEL1">Business</DIV>
    <SELECT ID='ADROP1' STYLE='display:none' ALIGN='LEFT' NAME='ASELFONE1' SIZE='1' OnChange="hideaddr('1');" OnBlur="hideaddr('1');">
    </SELECT>
    </TD>

    <TD WIDTH=10% ALIGN="LEFT">
    <BUTTON OnClick="seladdr('1');" ALIGN="LEFT"><IMG SRC="/arrow.gif" width=17 height=13></BUTTON>
    Business
    <SELECT ID='ADROP1' STYLE='display:none' ALIGN='LEFT' NAME='ASELFONE1' SIZE='1' OnChange="hideaddr('1');" OnBlur="hideaddr('1');">
    </SELECT>
    </TD>

    The only difference between them is "Business" in enclosed in a <DIV>
    I do this so I can access the .innerText and change the label.

    When Business is not enclosed in the <DIV>, the image and Business both
    fit on one line. When I enclose it in <DIV></DIV> the image is displayed
    and then Business on the next line. Apparantly the <DIV> adds some extra
    spacing. Enough that it makes it longer than my 10% allows for that column.

    Is there anything I can do? (I tried using STYLE="spacing-left:0pt"..)

    This is for IE.

    OR, is there another way, I can reference the "Business" easily to change it.
    without enclosing it with <DIVS> so I can give it an ID name?

    George

  • #2
    New Coder
    Join Date
    Aug 2004
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts
    <span>?

  • #3
    Regular Coder
    Join Date
    Jul 2003
    Location
    NJ - #29 if you must know
    Posts
    117
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Excellent....Span work just perfectly. Thanks

    George

  • #4
    Banned
    Join Date
    Sep 2003
    Posts
    3,620
    Thanks
    0
    Thanked 0 Times in 0 Posts
    This is an HTML/CSS question not a javascript question....
    However, the problem is is that <div> is a block level element and what you need to use is an inline element such as span as GP1183 advised...

    And although these two replies would seemingly answer your question. This is only the beginning of the problems with that code snippet. I would advise P/M'ing a Moderator and ask to have this question moved to the HTML/CSS forum where you would recieve better help with these other problems....

    ......Willy

  • #5
    Regular Coder
    Join Date
    Jul 2003
    Location
    NJ - #29 if you must know
    Posts
    117
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I put into the javascript area, since it involved the use of ID for
    referencing with Javascript routines and use of .innerText.

    As for whether there are better ways to accomplish the results
    with what is in the code snippit.....it works, and works well.

    However, I would like to hear any suggestions you might have
    for future uses..

    George

  • #6
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,043
    Thanks
    0
    Thanked 251 Times in 247 Posts
    Quote Originally Posted by ggallen
    However, I would like to hear any suggestions you might have
    for future uses..
    George
    Don't use innerText, it's an IE-only property. Use innerHTML or DOM instead.


  •  

    Posting Permissions

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