Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/80.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在css标签后的第2行html上将标签与收音机正确对齐_Html_Css - Fatal编程技术网

在css标签后的第2行html上将标签与收音机正确对齐

在css标签后的第2行html上将标签与收音机正确对齐,html,css,Html,Css,我有一个有风格的标签 <input type="radio" id="testRadio" /><label for="testRadio">this is my label with multiple line text, and the align on this label is not working from second line. I want to start the text of second line from the same position a

我有一个有风格的标签

<input type="radio" id="testRadio" /><label for="testRadio">this is my label with multiple line text, and the align on this label is not working from second line. I want to start the text of second line from the same position as first line</label>

input {
    width: auto;
    padding: 10px;
    margin: 10px !important;
}
这是我的多行文本标签,此标签上的对齐无法从第二行开始。我想从与第一行相同的位置开始第二行的文本
输入{
宽度:自动;
填充:10px;
利润率:10px!重要;
}
正如您所看到的,此标签上的文本有多行,但问题是当文本完成第一行并从第二行开始时,对齐不正确


此处仅供参考。

将标签设置为元素以使其正常工作

display: block;

更新fiddle

在css中设置标签显示:块的样式

最简单的方法是,正如第一个发布的答案所建议的,使用
显示:块。然而,由于存在替代方案,我想指出:

box-decoration-break: clone;
标签{
左边距:10%;
字体大小:24px;
-webkit盒装饰中断:克隆;
盒子装饰破裂:克隆;
}

这是我的多行文本标签,此标签上的对齐无法从第二行开始。我想从与第一行相同的位置开始第二行的文本
只需使用flex,然后像这样对齐父项:

。表单组{
显示器:flex;
对齐项目:居中;/*开始或结束*/
}

这是我的多行文字标签,此标签上的对齐无法从第二行开始。我想从与第一行相同的位置开始第二行的文本

在css中,您可以简单地设置文本对齐:justify,这将对其进行排序

label{
  margin-left:10%;
  font-size:24px;
  text-align: justify;
}

您可以添加
显示:内联块如果我的解决方案解决了您的问题,请将答案标记为已接受。否我更新了我的问题请重新查看问题解释标签的
显示:内联块
如何解决您的问题?更新了我的问题以便更好地理解更新了我的问题以便更好地理解