CSS实现标题和图片混合

Result

Code

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
.blend {
background-image: url("bear.jpg");
background-size: cover;
background-position: center;
padding: 5em 0 10em;
}
.blend>h1 {
margin: 0;
font-family: Arial, Helvetica, sans-serif;
font-size: 6rem;
text-align: center;
/* 使用强光混合模式 */
mix-blend-mode: hard-light;
background: #c33;
/* 为前景元素设置文字和背景颜色 */
color: #808080;
border: .1em solid #ccc;
border-width: .1em 0;
}
</style>
</head>
<body>
<div class="blend">
<h1>Ursa Major</h1>
</div>
</body>
</html>
posted @   Felix_Openmind  阅读(164)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· winform 绘制太阳,地球,月球 运作规律
· 超详细:普通电脑也行Windows部署deepseek R1训练数据并当服务器共享给他人
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· AI 智能体引爆开源社区「GitHub 热点速览」
· 写一个简单的SQL生成工具
*{cursor: url(https://files-cdn.cnblogs.com/files/morango/fish-cursor.ico),auto;}
点击右上角即可分享
微信分享提示