2016-01-06 12 views
0

我在我的文本区域css中添加了行高,但仍然没有被识别。文本区域仍然是双倍间距。行高在文本区域css不被识别

form div { 
position: relative; 
} 

input, 
select, 
textarea { 
@include transition(all, 0.3s, ease-in-out); 
background: $white-95; 
border-radius: 3px; 
border: 1px solid $white-85; 
box-sizing: border-box; 
color: $white-40; 
font: 16px/42px $font-body; 
font-size: 16px; 
margin: 0 0 20px; 
max-width: 100%; 
padding: 0 15px; 
width: 100%; 
line-height: normal; 
+0

这可能是默认的浏览器行高吗? – Nora

+0

不确定,我会查看浏览器是否在css中设置了默认值 – cratto

回答

0

您可以尝试为您的行高指定像素值以强制显示文本区域,只要您想要。

line-height: 20px; 
+0

也尝试过,没有任何东西似乎改变它 – cratto

0

令人沮丧的是,CSS可以设置行高,但不能在CSS中设置行数,只是内联。

由于默认值为2行,因此您的height = line-height * 2(rows)

所以答案:将老式rows属性1: <textarea rows="1"></textarea>