久久r热视频,国产午夜精品一区二区三区视频,亚洲精品自拍偷拍,欧美日韩精品二区

您的位置:首頁技術(shù)文章
文章詳情頁

css - 如何做一個完整的圓?裡面顯示數(shù)字

瀏覽:109日期:2023-01-26 09:40:50

問題描述

css - 如何做一個完整的圓?裡面顯示數(shù)字

數(shù)字有個位數(shù)到百位數(shù)

padding:10px; background-color:#F00; color:#fff; border-radius:50%;

<span class='alert'>9</span>

<span class='alert'>999</span>

如何讓它保持正圓的同時當有數(shù)字時不變形? 個位數(shù)和百位數(shù)

問題解答

回答1:

網(wǎng)上找了個

<p class='circle'> <span>999999</span></p>

.circle { display: inline-block; text-align: center; line-height: 1; background-color: red; border-radius:50%; font-size: 14px;}.circle span { display: block; padding: 50%; margin: -2em -50% 0; position: relative; top: 1em; border: 0.5em solid transparent; white-space: nowrap;}

http://jsfiddle.net/zcd75Lcd/

回答2:

你要行把span設(shè)置為block 設(shè)置個寬高像下面的樣式

width: 30px;height: 30px;background-color: #F00;color: #fff;border-radius: 50%;display: block;text-align: center;line-height: 30px;

回答3:

border-radius:xxx 寬度是 元素的長度的一半

標簽: CSS
相關(guān)文章:
主站蜘蛛池模板: 汉川市| 新丰县| 澎湖县| 天台县| 汕头市| 台北县| 益阳市| 治县。| 时尚| 平泉县| 凤凰县| 佛山市| 天峻县| 永福县| 连州市| 曲周县| 德江县| 增城市| 嘉善县| 大姚县| 玉田县| 和田县| 泗阳县| 田阳县| 仲巴县| 孟连| 景宁| 正定县| 论坛| 清涧县| 芦山县| 砚山县| 宁陕县| 南澳县| 遂昌县| 白银市| 遂溪县| 龙游县| 甘谷县| 玉环县| 江口县|