gpt4 book ai didi

html - IE 7/8 中文本输入的文本缩进替代方案

转载 作者:太空宇宙 更新时间:2023-11-04 15:30:28 25 4
gpt4 key购买 nike

这是我的 jsFiddle 示例:

http://jsfiddle.net/jsplashindia/LYUA5/1/

这是我的 HTML 和 CSS:

<html>
<head>
<style type='text/css'>
.testStyle {
text-indent:30px;
}
</style>

</head>
<body>

<input type="text" class="testStyle">

</body>
</html>

基本上我需要像这样在文本输入中缩进文本:

This is the expected behaviour

但是,在 IE 7 和 IE 8 中,我得到以下行为:

observed behaviour in IE7/8

我需要去掉文本输入字段的前导空格。除了使用 text-indext 之外,还有其他方法可以让我在 IE7/8 和所有其他浏览器中获得预期的行为吗?

最佳答案

添加float:left

.testStyle {
text-indent:30px;
float:left
}

DEMO

或者

使用padding-left

DEMO 2

关于html - IE 7/8 中文本输入的文本缩进替代方案,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13450963/

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