How to get the Tololtip Tail for Menu
Tags: javascript,jquery,html,css,tooltip
Problem :
HTML
<div id="MyForm">
<a> <img src="ImageMenu.png" /></a>
<ul>
<li>
<a class="selected" href="#">One</a>
</li>
<li>
<a href="#">Two</a>
</li>
<li>
<a href="#">Three</a>
</li>
</ul>
</div>
On clicking the ImageMenu.png, I'm displaying a Menu using JQuery. How to Get the Tooltip tail (Uparrow) just under the Menuimage using CSS?
Solution :
I think your looking something like this...
- One
- Two
- Three
CSS contains...
mymenu a
{ float: left; height: 30px; padding: 0 15px; color: #222; text-transform: uppercase; font: bold 12px/25px Arial, Helvetica; text-decoration: none; text-shadow: 0 1px 0 #000; }
mymenu li:hover > a
{ color: #222; }
html #mymenu li a:hover / IE6 */ { color: #222; }
mymenu li:hover > ul
{ display: block !important; }
/* Sub-menu */
#mymenu ul
{
list-style: none;
margin: 0;
padding: 0;
display: none !important;
position: absolute;
top: 25px;
width:150px;
z-index: 99999;
background: #fff;
background: -moz-linear-gradient(#555, #888);
background: -webkit-gradient(linear,left bottom,left top,color-stop(0, #888),color-stop(1, #555));
background: -webkit-linear-gradient(#555, #888);
background: -o-linear-gradient(#555, #888);
background: -ms-linear-gradient(#555, #888);
background: linear-gradient(#555, #888);
-moz-box-shadow: 0 0 2px rgba(255,255,255,.5);
-webkit-box-shadow: 0 0 2px rgba(255,255,255,.5);
box-shadow: 0 0 2px rgba(255,255,255,.5);
-moz-border-radius: 5px;
border-radius: 5px;
}
#mymenu ul li
{
float: none;
margin: 0;
padding: 0;
display: block;
-moz-box-shadow: 0 1px 0 #111111, 0 2px 0 #777777;
-webkit-box-shadow: 0 1px 0 #111111, 0 2px 0 #777777;
box-shadow: 0 1px 0 #111111, 0 2px 0 #777777;
}
#mymenu ul li:last-child
{
-moz-box-shadow: none;
-webkit-box-shadow: none;
box-shadow: none;
}
#mymenu ul a
{
padding: 7px !important;
height: 10px;
width: 135px;
height: auto;
line-height: 1.8em !important;
text-decoration: none !important;
font-weight:normal;
display: block;
white-space: nowrap;
float: none;
color:#fff;
text-transform: none;
text-align:left;
}
*html #mymenu ul a /* IE6 */
{
height: 10px;
}
*:first-child+html #mymenu ul a /* IE7 */
{
height: 10px;
}
#mymenu ul a:hover
{
background: #d7d7d7;
background: -moz-linear-gradient(#d7d7d7, #d7d7d7);
background: -webkit-gradient(linear, left top, left bottom, from(#d7d7d7), to(#d7d7d7));
background: -webkit-linear-gradient(#d7d7d7, #d7d7d7);
background: -o-linear-gradient(#d7d7d7, #d7d7d7);
background: -ms-linear-gradient(#d7d7d7, #d7d7d7);
background: linear-gradient(#d7d7d7, #d7d7d7);
color:#222;
text-shadow: none;
font-weight:bold;
border-bottom:#222;
}
#mymenu ul li:first-child > a
{
-moz-border-radius: 5px 5px 0 0;
border-radius: 5px 5px 0 0;
}
#mymenu ul li:first-child > a:after
{
content: '';
position: absolute;
left: 30px;
top: -8px;
width: 0;
height: 0;
border-left: 5px solid transparent;
border-right: 5px solid transparent;
border-bottom: 8px solid #444;
}
#mymenu ul li:first-child a:hover:after
{
border-bottom-color: #d7d7d7;
}
#mymenu ul li:last-child > a
{
-moz-border-radius: 0 0 5px 5px;
border-radius: 0 0 5px 5px;
}
WORKING DEMO: http://jsfiddle.net/nPeaV/7430/
CSS Howto..
Good question, and the answer is - yes, you can :) First of all, you need to clone project-stub repo and install dependencies: git clone git@github.com:bem/project-stub.git cd project-stub npm i...
By placing your ball/circle image inside a container div and rotating that div, you can create the illusion of the ball traveling around the background. You will have to play...
Replace this code $('[id=selectedTab]').addClass('selected'); with $('[id='+selectedTab+']').addClass('selected'); or with $('#'+selectedTab).addClass('selected'); You have your selected tab id in selectedTab variable, but you are using it as literal, so concat this selectedTab with...
You can use gt() with a negative index to count backwards from the last element. if (window.screen.width > 960) { // you asked for "screen" $('.tdiv:gt(-5)').css('border','none'); } FIDDLE...
You can't. The [...] selectors only work on attributes, not element types themselves. What you can do though, as I'm sure you're already aware, is chain them all into one...
Add the below lines to your CSS: white-space: nowrap; /* will prevent the default wrapping of text to next line */ overflow-x: auto; /* will make horizontal scroll-bar appear only...
assuming you want the same visual margin/padding: http://jsfiddle.net/2U4Uv/2/ .sidebar { background: none repeat scroll 0 0 #F4F4F4; float: left; min-height: 600px; width: 250px; } .sidebar ul { float: left; list-style:...
You'll need to set a height to the container and then you can hide the overflow of the nested font-awesome icon, using overflow:hidden. CSS: .clipped-alert{ overflow:hidden; height:55px; } HTML: <div...
Note the additional position: relative on .number. Jsfiddle. .number { width: 8em; display: block; word-wrap: break-word; columns: 5; -webkit-columns: 5; -moz-columns: 5; column-gap: 0.2em; -webkit-column-gap: 0.2em; -moz-column-gap: 0.2em; text-decoration: underline;...
If it is a border dotted use .container-body{ border:none; } Or it is outline use as per Mukesh Ram posted the answer .container-body{ outline:none; } ...
You can do it in CSS: .myPanel div { margin-top: 5px; } ...
Just check this: http://jsfiddle.net/SQ9Hf/2/ You need to put some float, and the best thing to do is to put each div with a % width....
If you are ready to opt for CSS3, you can use css3 translate property. Resize based on whatever is bigger. If your height is bigger and width is smaller than...
You could just do this: .ancestor { background-color: #ccc; } .parent { background-color: #fff; } .child { background-color: #ccc; } or you could do: .ancestor { background-color: #ccc; } .parent...
Assuming you are on a UNIX-like system… Copy /usr/share/vim/vim7x/autoload/csscomplete.vim to ~/.vim/autoload/csscomplete.vim Find the loop that generates the list of properties, for me it's at line 92. Remove the colon from...
You have a few problems with your stylesheet: Firstly, you're using this .readmoretext A. The correct CSS selector for an anchor tag is a lowercase "a", so this needs correcting...
You can just apply it to the form tag. ...
try following (is that what you want): var $containers = $(".fieldContainer"); // First Show the First Element & Focus it $containers.eq(0).fadeIn(500).find("input").focus(); // Setup a transition handler: $containers.find("input").keyup(function(ev) { ev.preventDefault(); ev.stopPropagation();...
You might be able to generate this using the :after pseudo element. Something like: .achievement-title-before:after { content: ""; position: absolute; /*Set height and width*/ height: 30px; width: 30px; /*make it...
If the space between the arrows does not need to be transparent (it is solid color) you can use the :before and :after to create the edges (without new elements...
If you mean a sticky footer, which is always on bottom position at less content. When more content is visible the footer is scollable again. One way is to use...
Here's a version that changes text-color and border-color, instead of background. /* CSS */ .modal_button { min-height: 2em; width: 5em; background-color: white; border: 2px solid #f35626; color: #f35626; cursor: pointer;...
The easiest way is to get the current controller and action from the ViewContext's RouteData. Note the change in signature and use of @ to escape the keyword. <% var...
echo "<style type='text/css'>"; echo ".normalbackground {background-color: white;}"; echo ".coloredbackground {background-color: #CEED5E;}"; echo "</style>"; echo "<table border=1>"; echo "<tr><th>Product...
This is a common occurrence in Bootstrap with logos, and you need more context, because there are other ways to do this, but based on your snippet of code, you...
I think that this should do what you want: div.ImageTitle { width: 100px; /* or whatever */ white-space: nowrap; text-align: center; overflow: hidden; } JS Fiddle demo. Note that I'm...
If you inspect the jQuery UI website using your browser's web inspector, you can see that in the <iframe> containing the buttons you mention, the following CSS is applied: body...
2 ways to approach your problem: 1. Pure CSS Just increase the specifity of your selector: #Mod149 > div.moduletable-inner { box-shadow: 0px 0px 0px 0px rgba(0,0,0,.25); } 2. Using JavaScript...
You need to be specifying widths in appropriate places, all elements are responding in a similar way but because you have relatively positioned #text1 negative it'll go off when the...
Check out http://net.tutsplus.com/tutorials/html-css-techniques/how-to-create-diagonal-lines-with-css/ -- that should point you in the right direction!