Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 09-08-2012, 12:24 AM   PM User | #1
johnsmith153
New Coder

 
Join Date: Mar 2012
Posts: 81
Thanks: 7
Thanked 0 Times in 0 Posts
johnsmith153 is infamous around these parts
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.
johnsmith153 is offline   Reply With Quote
Old 09-08-2012, 12:27 AM   PM User | #2
Sammy12
Registered User

 
Join Date: Jun 2011
Posts: 1,063
Thanks: 12
Thanked 241 Times in 240 Posts
Sammy12 is on a distinguished road
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..
Sammy12 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:45 PM.


Advertisement
Log in to turn off these ads.