标签文字已换行,但没有缩进第二行 [英] Label text is wrapped but not indent second line

查看:413
本文介绍了标签文字已换行,但没有缩进第二行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的表单宽度有限,但是标签文本可能比表单宽度长,因此文本被包装成多行.我的问题是,由于输入元素而使第一行缩进,但第二行没有缩进,这会使表格不好看.

I have a form with limited width, however the label text maybe longer than form width, so the text was wrapped to multiple lines. My problem is that first line is indented because of input element but second line is not, it makes the form not nice.

您是否有想法将第二,第三...缩进为第一行,仅使用CSS?

Do you have any idea to make the second, third ... will be indented as first line, only use CSS?

实际:

我的期望是

这是我的例子:

http://jsbin.com/UvaqISO/2/edit

推荐答案

像这样编辑您css:

.form {
  width: 300px;
}
label {
  display: block;
  margin-top: -20px;
  margin-left: 20px;
}

这篇关于标签文字已换行,但没有缩进第二行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆