我有一個跨度display:none
但仍然需要它的高度&寬度,有沒有辦法實現它,而無需更改顯示或使用visibility:hidden
?使用顯示器:沒有但仍然保持使用的空間
.mySpan{
display:none;
}
<div>
<label>Name</label>
<input type="text" id="personName" name="personName" />
<br/>
<span class="mySpan">Text that can be displayed or not</span>
</div>
<div>
<label>Last name</label>
<input type="text" id="personLastName" name="personLastName" />
<br/>
<span class="mySpan">Text that can be displayed or not</span>
</div>
我需要跨度的高度,使總有像visibility=hidden
的div之間的距離。
你需要向我們解釋爲什麼你不想使用可見性:隱藏其中的方式做你想要的 – mplungjan
包裝跨越到另一個元素和設置寬度和高度 - – Shin
你可以使用'不透明度:0',但裏面的任何內容仍然是棘手的。你可以點擊文本等。 – pol