<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.51sjk.com/Upload/Articles/1/0/321/321859_20220815180130457.jpg"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>背景透明文字不通明</title> <style type="text/css"> .item{width:400px;height:300px;margin:0 auto;position:relative;} .hi,h3{position:absolute;left:0;bottom:0;width:100%;height:30px;} h3{line-height:30px;color:#fff;margin:0;z-index:1;}/*给文字设置了z-index值这样文字就不会透明了*/ .hi{background:red;opacity:0.4;}/*透明背景*/ </style> </head> <body> <h1>背景透明文字不透明的做法</h1> <div class="item"> <p> <img src="http://www.51sjk.com/Upload/Articles/1/0/321/321859_20220815180132629.jpg" /> </p> <h3>你看我是不是没有透明啊</h3> <div class="hi"></div> </div> </body> </html>
XHTMT|
HTML5|
CSS|
HTML DOM|
jQuery|
JSON|
AJAX|
LESS|
HTML|
Bootstrap|
Foundation|
AngularJS|
Ember.js|
TypeScript|
AngularJS2|
React|
jQuery UI|
jQuery EasyUI|
Node.js|
Highcharts|
Echarts|
Vue.js|
CoffeeScript|
Ext.js|
Meteor|
SASS|
Omi|
Markdown|
前端开发规范|
浏览器|
webpack|
JavaScript|
CSS3|
用户登录
还没有账号?立即注册
用户注册
投稿取消
文章分类: |
|
还能输入300字
上传中....