Html 需要帮助将工具提示放置在标签右侧吗
我有一个属性信息表,每个标题都有一个工具提示。我需要将工具提示放置在标签的右侧,使其垂直居中。我是一个CSS初学者,并且用它来操作html元素。下面是我的代码。这是一个大项目,所以我无法得到所有的css,使其与包含的图片相匹配,但希望你能有大致的想法 如果你只需要看一眼的话,这是我的表格标题的样本Html 需要帮助将工具提示放置在标签右侧吗,html,css,html-table,tooltip,Html,Css,Html Table,Tooltip,我有一个属性信息表,每个标题都有一个工具提示。我需要将工具提示放置在标签的右侧,使其垂直居中。我是一个CSS初学者,并且用它来操作html元素。下面是我的代码。这是一个大项目,所以我无法得到所有的css,使其与包含的图片相匹配,但希望你能有大致的想法 如果你只需要看一眼的话,这是我的表格标题的样本 <th rowspan="2" data-field="Address"> <span>Property<br />address</span>
<th rowspan="2" data-field="Address">
<span>Property<br />address</span>
<a style="position: relative; top: 25%; right: 0;" tabindex="0" role="button"
data-toggle="popover" data-container="body" data-trigger="hover click"
title="Property address" data-content="An all-inclusive list of properties associated
to your agreement">
<span class="glyphicon glyphicon-question-sign info-popover"></span>
</a>
</th>
属性
地址
实现这一点的一种方法是使用位置
您可以从创建
开始,这将允许放置在其中的项目遵守其自身的边界
接下来,您将使用
EDIT2:这里是另一篇StackOverflow帖子,解释我为您制定的规则
th > a {
position: absolute;
//these two rules put it vertically centered no matter what inside of the container
top: 50%;
transform: translateY(-50%);
//and then set the right to however far you'd like it away from the right side of the <th>
right: 20px;
}