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 2 of 2
  1. #1
    New Coder
    Join Date
    Mar 2012
    Posts
    81
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Form inside tooltip?

    I want to place a form inside a tooltip, but CSS-only tooltips are something like this:

    <a>Anchor<span>Tooltip content here</span></a>

    ...which of course would be this:

    <a>Anchor<span><form>form content</form></span></a>

    ...which works, but apparently isn't good standard.

    What do I do?

    I want to put any HTML, including <div>'s in the tooltip.

  • #2
    Registered User
    Join Date
    Jun 2011
    Posts
    1,063
    Thanks
    12
    Thanked 241 Times in 240 Posts
    Quote Originally Posted by johnsmith153 View Post
    ...which works, but apparently isn't good standard.
    That's correct, using block elements inside inline elements is "incorrect".

    You can just wrap the tooltip in a <form>:

    Code:
    form {
         cursor: pointer; /* ? don't know why you wrapped a form in <a> */
    }
    div {
         display: inline-block;
    }
    Code:
    <form>
        <label> 
             <a href="#">Anchor</a>
        </label>
        <div><!-- form content --></div>
    </form>
    By your original code, if the form content was clicked it would go to the <a> link. Then what's the purpose of a form?
    Last edited by Sammy12; 09-08-2012 at 12:32 AM.


  •  

    Posting Permissions

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