Html 文本周围的背景色

Html 文本周围的背景色,html,css,Html,Css,如何将边设置为这样的圆角。 这是一个很好的例子,你的信息是什么。 在样式中使用“边界半径”标记 乙二醇 它叫。它有几个变体,所以请阅读该链接 HTML: <div class="rounded"> Lorem Ipsum Stuff </div> .rounded { -moz-border-radius: 10px; /* For Firefox/Gecko Engine */ -webkit-border-radius: 10px; /

如何将边设置为这样的圆角。


这是一个很好的例子,你的信息是什么。

在样式中使用“边界半径”标记

乙二醇

它叫。它有几个变体,所以请阅读该链接

HTML:

<div class="rounded">
    Lorem Ipsum Stuff
</div>
.rounded {
    -moz-border-radius: 10px; /* For Firefox/Gecko Engine */
    -webkit-border-radius: 10px; /* For Safari + Chrome*/
    border-radius: 10px; /* For IE 9+*/
    background: #be4298;
    padding: 8px;
    width: 130px;
}
请注意,现在只需要使用
边界半径
,因此除非您完全确定没有旧浏览器会使用您的站点,否则请包括其他两个

不要使用
这是90年代早期html的一种方式,而是使用css样式

html


这只适用于较新的浏览器。请添加有关如何在IE中执行的信息。感谢您的示例,但为什么我不将文本四舍五入,我不需要空白。这是我上面代码中的问题吗?这是因为您的标签未正确关闭。您应该关闭标签,如
.

。基本上是一个块元素,它采用全宽度,因为块元素倾向于采用全宽度。因此,由于标签未正确关闭,您可以获得全宽。请稍候,我编辑您的问题并更正标签关闭
<div class="rounded">
    Lorem Ipsum Stuff
</div>
.rounded {
    -moz-border-radius: 10px; /* For Firefox/Gecko Engine */
    -webkit-border-radius: 10px; /* For Safari + Chrome*/
    border-radius: 10px; /* For IE 9+*/
    background: #be4298;
    padding: 8px;
    width: 130px;
}
<p>
<span>Dieses Feld darf nicht leer sein, geben Sie bitte die erforderliche Information ein.</span>
</p>
p {
    padding: 7px;
    border: 2px dashed gray; /* to create a dashed border over the text */
    width: auto;
    display: inline;
}

span {
    background-color: #9B3434;
    color: #fff;
    padding: 5px;
    border-radius: 5px; /* this gives the rounded look */
    font-family: arial;
    font-size: 12px;
}

body {
    margin: 20px; /* for showing the example well, ignore this */ 
}