似乎CSS默认为100%,但我希望它只需要包含填充所需的宽度:
.circle {
border-radius: 50%;
background: pink;
padding: 10px;
text-align: center;
/* width and height can be anything, as long as they're equal */
}
我如何实现这一目标?
答案 0 :(得分:2)
在css中添加float:left
或display:inline-block;
答案 1 :(得分:2)