CSS background-color示例
html公开前 25 行,完整代码需登录
<!DOCTYPE html>
<html>
<head>
<style>
.bgColor-box {
width: 100%;
height: 300px;
border: 1px solid #aaa;
display: flex;
align-items: center;
justify-content: center;
font-size: 1.2rem;
color: #222;
margin-bottom: 5px;
}
.bgColor-1 {
background-color: #2196F3;
}
.bgColor-2 {
background-color: rgba(52,152,219,0.5);
}
</style>
</head>
<body>
<div class="bgColor-box bgColor-1">纯色背景</div>