在CSS3中,Border-radius屬性用來設置邊框的圓角。是CSS3中級別最高的一個屬性。
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
注意:請在Safari 5和IE9瀏覽器中執行“border-radius”語法。
這個屬性可以做一個圓。
-moz-border-radius: 50px;
-webkit-border-radius: 50px;
border-radius: 50px;
如果想再添加點效果,我們可以利用Flexible Box Model來使得文字在垂直在水平方向都居中。這需要加點代碼,但這僅僅是對不同瀏覽器的補償。
display: -moz-box;
display: -webkit-box;
display: box;
-moz-box-orient: horizontal; /* the default, so not really necessary here */
-webkit-box-orient: horizontal;
box-orient: horizontal;
-moz-box-pack: center;
-moz-box-align: center;
-webkit-box-pack: center;
-webkit-box-align: center;
box-pack: center;
box-align: center;
新聞熱點
疑難解答