我有这段代码将一个工具提示置于一个元素下面。它工作正常的大于或等于提示的宽度的元素:如何将工具提示置于比工具提示更窄的元素下方?
HTML:
<div class="my_class">Some Stuff<div class="tooltip_botom">My Very Long Tooltip Contents</div></div>
CSS:
.my_class {
position: relative;
width: 100%;
height: 100%;
}
.tooltip_bottom {
position: absolute
bottom: -25px
left: 0
right: 0
display: inline
text-align: center
}
可是我该怎么办,如果内容是窄于工具提示宽度?上面列出的CSS在这种情况下不起作用。我该如何解决它?
我要的是工具提示到div下方居中。 – 2014-11-03 13:48:33