伪元素后不显示? [英] Pseudo-element after not showing?
问题描述
我想在某些表单字段的末尾添加帮助徽标,以打开工具提示.
I want to add a help logo at the end of some form fields which opens a tooltip.
一切正常,但是.helptip图标( http://img1.wsimg.com/shared/img/1/small-help-icon.gif )与文字一起出现在左侧(合并).我实际上想要在跨度文本的右边,所以我做了.help-tip:after.但是然后什么也没有出现.
Everything is working, but the .helptip icon (http://img1.wsimg.com/shared/img/1/small-help-icon.gif) is coming on the left(merged) with the text. I actually want in on the right of span text, so I did .help-tip:after. But then nothing shows up at all.
您能找出问题所在吗?
<div class="advancedSearchFormSelectField fclear">
<span id="view_format_mis" class="advancedSearchFormlabel help-tip"> Include Columns in Result Set </span>
<select class="advancedSearchFormSelectBox" id="filters_include_columns" multiple="multiple" name="filters[include_columns][]">
<option value="x">X</option>
<option value="y">Y</option>
<option value="z">Z</option>
</select>
</div>
<div class="advancedSearchFormSelectField fclear">
<span id="view_format_mis" class="advancedSearchFormlabel"> Sort Column </span>
<!--No help tip here -->
<select class="advancedSearchFormSelectBox" id="filters_sort_columns" multiple="multiple" name="filters[sort_columns]">
<option value="a">A</option>
<option value="b">B</option>
<option value="c">C</option>
</select>
</div>
.help-tip {
/* Merged text at the moment. .help-tip:after not working */
cursor: pointer;
width: 10px;
height: 10px;
background-repeat: no-repeat;
background-image: url("/assets/small-help-icon.gif");
}
.advancedSearchFormSelectField{
width:300px;
margin: 5px;
height: 60px;
float:left;
}
推荐答案
您目前似乎没有使用伪元素.尝试将此设置从.help-tip
设置为.help-tip::after
,并给出content: ""
和display: inline-block
:
You don't seem to be using a pseudo-element at the moment. Try this setting .help-tip
to .help-tip::after
and giving is content: ""
and display: inline-block
:
.help-tip::after {
content: "";
display: inline-block;
cursor: pointer;
width: 10px;
height: 10px;
background-repeat: no-repeat;
background-image: url("/assets/small-help-icon.gif");
}
这篇关于伪元素后不显示?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!