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