我想在圆圈内放置文字.当文本增加时,是否可以动态增加圆的大小?
这是一个例子.
但在这个例子中,我的问题是只有宽度随文本一起增加.
例如
.badge {
background: radial-gradient( 5px -9px, circle, white 8%, red 26px );
background: -moz-radial-gradient( 5px -9px, circle, white 8%, red 26px );
background: -ms-radial-gradient( 5px -9px, circle, white 8%, red 26px );
background: -o-radial-gradient( 5px -9px, circle, white 8%, red 26px );
background: -webkit-radial-gradient( 5px -9px, circle, white 8%, red 26px );
background-color: red;
border: 2px solid white;
border-radius: 12px; /* one half of ( (border * 2) + height + padding ) */
box-shadow: …
Run Code Online (Sandbox Code Playgroud)我想要文本字段中的文本,例如“你的名字*”,
“你的名字”的颜色应该是黑色,* 的颜色应该是红色。
我怎样才能做到这一点??
请帮我。
.ec-circle{
width: 420px;
height: 420px;
-webkit-border-radius: 210px;
-moz-border-radius: 210px;
border-radius: 50%;
text-align: center;
overflow: hidden;
font-family:'Kelly Slab', Georgia, serif;
background: #dda994 url(../images/1.jpg) no-repeat center center;
box-shadow:
inset 0 0 1px 230px rgba(0,0,0,0.6),
inset 0 0 0 7px #d5ad94;
transition: box-shadow 400ms ease-in-out;
display: block;
outline: none;
}
Run Code Online (Sandbox Code Playgroud)
上面的代码就像我想要的但不满足我的需要.
它是分辨率为230 x 231的图像.当悬停在图像上时,
它将仅显示圆形部分.
怎么会这样?