我想选择#btnsrchicon父母的孩子#txtSearch。我想在下面的格式,但不工作我可以在CSS中选择以前的兄弟吗?
HTML
<div id="topSearch">
<input id="txtSearch" name="search" type="text" value="" id="txtSearch" onClick="ClearTextBox()" onkeypress="searchenter(event);"/>
<button id="btnsrchicon" class="submit" onClick="search_another();"></button>
</div>
和CSS
<style>
#txtSearch{display:none;}
#btnsrchicon:hover < #topSearch+#txtSearch
{
display: block;
border:2px solid red;
}
</style>
这是不可能的:( –
你的意思是以前的兄弟选择器?你的按钮元素没有任何子元素 – TylerH
是的,以前的兄弟 – ManiMuthuPandi