Note that there are some explanatory texts on larger screens.

plurals
  1. POtooltip css/html
    primarykey
    data
    text
    <p>I’m trying to create the affect of a tool tip with a triangle pointer on top of an unordered list. To create the triangle, I thought I would just create a square div, rotate it 45 degrees, and give it the same background color as the unordered list.</p> <p>As you can probably guess, this works great in everything except in IE. The problem I’m having is that it seems that the overflow is hidden on the ul, so when I position the pointer div half outside of the ul to create the triangle effect, the top half of the div is hidden.</p> <p>I have tried to change overflows and z-indexes to get this to work, but no luck. I’m thinking it has to do with the gradient filter applied to the ul, maybe that applies an overflow rule? I know I can probably just move the pointer div outside of the list, but this will be display on hover of another element, and I’d rather just display the ul on hover, instead of the ul and the div.</p> <p>Does anybody know how I can fix this?</p> <p>Chrome screen shot <img src="https://i.stack.imgur.com/YPLEp.png" alt="enter image description here"></p> <p>IE screen shot <img src="https://i.stack.imgur.com/YbA8H.png" alt="enter image description here"></p> <p>NOTE: I added borders to the rotated div to make it easier to tell what I'm talking about.</p> <p>HTML</p> <pre><code>&lt;ul&gt; &lt;li&gt;&lt;div id="pointer"&gt;&lt;/div&gt;&lt;a href="#"&gt;List Item 1&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;List Item 2&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;List Item 3&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;List Item 4&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;List Item 5&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;List Item 6&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;List Item 7&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;List Item 8&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;List Item 9&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;List Item 10&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;List Item 11&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;List Item 12&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;List Item 13&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;List Item 14&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;List Item 15&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;List Item 16&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;List Item 17&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;List Item 18&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;List Item 19&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;List Item 21&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;List Item 22&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;List Item 23&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; </code></pre> <p>CSS</p> <pre><code>ul { position:absolute; top:41px; left:175px; width:540px; height:361px; padding:0; z-index:15; margin-bottom:20px; border:1px solid #DEDCD9; border-right:none; background-color: #F5EFE3; -moz-border-radius: 0 0 0 12px; -webkit-border-radius: 0 0 0 12px; border-radius: 0 0 0 12px; background-image: -moz-linear-gradient(top, #F5EFE3, #FFF); /* FF3.6 */ background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0, #F5EFE3),color-stop(1, #FFF)); /* Saf4+, Chrome */ background-image: -webkit-linear-gradient(#69F5EFE3A89D, #FFF); /* Chrome 10+, Saf6 */ background-image: linear-gradient(top, #F5EFE3, #FFF); filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#F5EFE3', EndColorStr='#FFFFFF'); /* IE6–IE9 */ } ul li { display:inline; line-height:32px; width:269px; border-right:1px solid #DEDCD9; border-bottom:1px solid #DEDCD9; float:left; margin:0; padding:0; overflow:visible; } ul li a { display:block; text-transform:none; padding-left:20px; color:#407d85; } #pointer { position:absolute; height: 15px; width: 15px; left:10px; top:-8px; border:1px solid black; /*border:0;*/ background-color:#F5EFE3; -webkit-transform:rotate(45deg); -moz-transform:rotate(45deg); transform:rotate(45deg); filter: progid:DXImageTransform.Microsoft.Matrix(sizingMethod='auto expand', M11=0.7071067811865476, M12=-0.7071067811865475, M21=0.7071067811865475, M22=0.7071067811865476); /* IE6,IE7 */ -ms-filter: "progid:DXImageTransform.Microsoft.Matrix(SizingMethod='auto expand', M11=0.7071067811865476, M12=-0.7071067811865475, M21=0.7071067811865475, M22=0.7071067811865476)"; /* IE8 */ } .lte8 #pointer { top:-12px; } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload