html - Adding icon next to fieldset legend title and displaying tooltip -


i'd add icon right of fieldset title. this:

--title[icon]------- |                  | | content          | |                  | -------------------- 

when hover on icon tooltip supposed displayed. having issues. reason icon being pushed below title (see screen shot).

enter image description here

not that, because of css, fieldset border around tooltip div. want fieldset border remain same , have tooltip hover on border.

i've tried playing around divs , css desired effect, nothing seems work me.

in summary, i'd have icon appear right of fieldset title , not have fieldset border pushed around tooltip. rather, want tooltip hover on fieldset border.

update: if js way accomplish this, i'd paste div content elsewhere on page , relatively position div right of icon. in other words, no matter icon sits on page, want div display right of it.

live example: http://jsfiddle.net/akyym/3/

html:

<fieldset class="gridfacet" >  <legend>title      <div class="tooltipcontainer">       <a class="tooltipicon" href="">         <img src="/content/themes/images/info-small-black-13px.png"/>     </a>          <div class="tooltip">             <strong>a</strong> - content<br/>             <strong>b</strong>  - content<br/>             <strong>c</strong>  - content<br/>             <strong>d</strong>  - content<br/>             <strong>e</strong>  - content<br/>         </div>     </div>     </legend>          <p class="chkrow">             <input id="h10" type="checkbox" class="chkfacet" value="h10" />             <label for="h10" class="lblfacet">                 a</label>         </p>         <p class="chkrow">             <input id="t3" type="checkbox" class="chkfacet" value="t3" />             <label for="t3" class="lblfacet">                 b</label>         </p>           <p class="chkrow">             <input id="u1" type="checkbox" class="chkfacet" value="u1" />             <label for="u1" class="lblfacet">                 c</label>         </p>           <p class="chkrow">             <input id="u2" type="checkbox" class="chkfacet" value="u2" />             <label for="u2" class="lblfacet">                 d</label>         </p>           <p class="chkrow">             <input id="u3" type="checkbox" class="chkfacet" value="u3" />             <label for="u3" class="lblfacet">                 e</label>         </p> </fieldset> 

css:

.gridfacet {     width: 50px; }  .tooltipcontainer {     width: 325px;     position: relative; }  .tooltipicon {     text-decoration: none; }      a.tooltipicon:hover + div {         display:block;         float: right;     }  .tooltip {     margin: -43px 0 5px 50px;     *margin: -12px 0 5px 15px; /* ie7 , below */     padding: 10px 0 10px 10px;     width: 250px;     height: 110px;     background-color: #e9ebec;     position: absolute;     border: 2px solid #739e40;     display: none;     font-size: 1.2em; }  .tooltip:after, .tooltip:before {     border: solid transparent;     content:' ';     height: 0;     right: 100%;     position: absolute;     width: 0; }  .tooltip:after {     border-width: 11px;     border-right-color: #e9ebec;     top: 13px; }  .tooltip:before {     border-width: 14px;     border-right-color: #739e40;     top: 10px; } 

i'm guessing main problem tooltipcontainer div within legend technically accepts "phrasing content" not include div: mdn

but if change tooltipcontainer div span element should work fine:

<legend>title <span class="tooltipcontainer">       <a class="tooltipicon" href="">         <img src="/content/themes/images/info-small-black-13px.png"/>     </a>         <div class="tooltip">             <strong>a</strong> - content<br/>             <strong>b</strong>  - content<br/>             <strong>c</strong>  - content<br/>             <strong>d</strong>  - content<br/>             <strong>e</strong>  - content<br/>         </div>     </span>  </legend> 

here's fiddle.


Comments

Popular posts from this blog

c++ - CryptStringToBinary API behavior -

c++ - Correct method for redrawing a layered window -

java.util.scanner - How to read and add only numbers to array from a text file -