如何用css控制按钮的样式,能实现在按钮上任意书写文字的效果更好

html-css019

如何用css控制按钮的样式,能实现在按钮上任意书写文字的效果更好,第1张

#bo1

{margin-top:1pxborder-left:1px

solid

#555555border-right:1px

solid

#555555border-top:1px

solid

#555555line-height:26pxbackground-color:#999999color:#ff0000font-size:18pxfont-family:隶书}

用border

及solid设置过框。再用background-color设置背景,同时用color设置字体颜色。font-family设置字体。用margin定位好,就可以了

需要准备的材料分别有:电脑、浏览器、html编辑器。

1、首先,打开html编辑器,新建html文件,例如:index.html。

2、在index.html中的<body>标签中,输入html代码:。

<div style="margin-top: 30pxwidth: 200pxheight:80pxborder: 1px solid blue">

<div style="background-color: whiteposition: absoluteleft: 30pxtop: 15px">文字</div>

</div>

3、浏览器运行index.html页面,此时实现了边框角落开口显示文字。