You can use the background-color attribute in css to change the color within the border. You only need to set the "background-color: color value" style to the input element. The background-color attribute sets the background color of the element. The value is the color name, hexadecimal value and RGB code.
The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.
Create html file and set page background color. Create h1 tag and content, create p tag and content, set border and border background color for h1 element. Sets the border and border background color for the p element.
<!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>
The effect is as follows:
Recommended learning: css video tutorial
The above is the detailed content of How to set the color of the border in css. For more information, please follow other related articles on the PHP Chinese website!