css印章制作
CSS 印章制作方法
使用 CSS 制作印章效果可以通过边框、圆角、阴影和文本装饰等属性实现。以下是几种常见的印章样式实现方法。
圆形印章
通过 border-radius 设置为 50% 创建圆形边框,结合 border 和 box-shadow 增强视觉效果。
.seal-circle {
width: 150px;
height: 150px;
border-radius: 50%;
border: 3px solid red;
box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
display: flex;
justify-content: center;
align-items: center;
font-family: "SimSun", serif;
color: red;
text-align: center;
line-height: 1.2;
}
方形印章
方形印章通常使用实线边框和红色填充,搭配旋转文本效果。
.seal-square {
width: 120px;
height: 120px;
border: 2px solid red;
display: flex;
justify-content: center;
align-items: center;
font-family: "SimSun", serif;
color: red;
text-align: center;
transform: rotate(-15deg);
box-shadow: 0 0 8px rgba(255, 0, 0, 0.5);
}
文字环绕效果
使用 transform 和伪元素实现文字环绕印章边缘的效果。
.seal-text-around {
position: relative;
width: 160px;
height: 160px;
border-radius: 50%;
border: 2px dashed red;
margin: 20px;
}
.seal-text-around::before {
content: "• 公章专用 • 公章专用 •";
position: absolute;
top: 10px;
left: 0;
right: 0;
text-align: center;
color: red;
font-family: "SimSun", serif;
font-size: 12px;
}
五角星图案
通过 CSS 绘制五角星作为印章中心图案。
.seal-star {
position: relative;
width: 0;
height: 0;
color: red;
margin: 20px auto;
border-right: 30px solid transparent;
border-bottom: 20px solid red;
border-left: 30px solid transparent;
transform: rotate(35deg);
}
.seal-star::before {
content: "";
position: absolute;
top: -12px;
left: -32px;
width: 0;
height: 0;
border-right: 30px solid transparent;
border-bottom: 20px solid red;
border-left: 30px solid transparent;
transform: rotate(-70deg);
}
组合完整印章
将圆形边框、环绕文字和五角星组合成完整印章效果。
<div class="seal-complete">
<div class="seal-text-around">公司名称</div>
<div class="seal-star"></div>
<div class="seal-number">编号:123456</div>
</div>
.seal-complete {
width: 180px;
height: 180px;
border-radius: 50%;
border: 3px solid red;
position: relative;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
box-shadow: 0 0 10px rgba(255, 0, 0, 0.3);
}
.seal-number {
position: absolute;
bottom: 20px;
color: red;
font-family: "SimSun", serif;
font-size: 12px;
}
这些方法可以通过调整尺寸、颜色和文本内容来适应不同场景的印章需求。







