gpt4 book ai didi

html - 如何使文本溢出对 HTML 中的输入元素可见?

转载 作者:行者123 更新时间:2023-11-28 16:55:08 24 4
gpt4 key购买 nike

如何使以下代码段中的输入值完全可见(以“溢出:可见”方式)?

<input type="submit" value="XXXXX" style="width: 5px;">

最佳答案

如果可以将其包装在 div 中,则可以使用::before 和::after css 元素。您可以将所需的文本附加到该伪元素。输入字段不接受伪元素。

.a {
position:relative;
width:5px;
display: inline-block;
}
.a::before {
position: absolute;
content: 'xxxxx';
display: block;
top: 0;
bottom: 0;
left: 0;
width: 100px;
z-index:10
}
<div class="a">
<input type="submit" value="XXXXX" class="a">
<div>

关于html - 如何使文本溢出对 HTML 中的输入元素可见?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57313982/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com