您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

css怎么设置边框内颜色

2026/2/19 23:40:45发布12次查看
css中可使用background-color属性改变边框内颜色,只需要给input元素设置“background-color:颜色值”样式即可。background-color属性设置元素的背景颜色,值为颜色名称、十六进制值和rgb代码。
本教程操作环境:windows7系统、css3&&html5版、dell g3电脑。
创建html文件,设置页面背景颜色。创建h1标签和内容,创建p标签和内容,为h1元素设置边框和边框背景颜色。为p元素设置边框和边框背景颜色。
<!doctype html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>document</title> <style>h1{ border: 1px solid red; background-color: rgb(113, 255, 201);}p{ border: 1px solid #fff; background-color: rgb(255, 182, 113);}</style></head> <body bgcolor="#ccc"> <h1>这是一个标题</h1> <p>这是一个段落,这是一句话。</p></body> </html>
效果如下:
推荐学习:css视频教程
以上就是css怎么设置边框内颜色的详细内容。
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product