0

这里是我的jsfiddle例如:TEXT-INDENT替代7/8

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和所有其他浏览器中获得预期的行为?

回答

1

添加float:left

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

DEMO

或者

使用padding-left

DEMO 2

+0

Thant工作!谢谢Sowmya ... –

+0

我欢迎.... – Sowmya