首页 / CSS / CSS3----文本新增样式
CSS3----文本新增样式
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了CSS3----文本新增样式,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含3100字,纯文字阅读大概需要5分钟。
内容图文
<! DOCTYPE html > < html > < head > < meta charset ="UTF-8" > < title ></ title > < style type ="text/css" > * { margin : 0 ; padding : 0 ; } #wrap { width : 300px ; height : 300px ; margin : 100px auto ; background : pink ; opacity : 0.1 ; } #inner { width : 100px ; height : 100px ; background : deeppink ; } </ style > </ head > < body > < div id ="wrap" > < div id ="inner" > inner </ div > </ div > </ body > </ html >
设置文字阴影
<! DOCTYPE html > < html > < head > < meta charset ="UTF-8" > < title ></ title > < style type ="text/css" > * { margin : 0 ; padding : 0 ; } #wrap { width : 300px ; height : 300px ; margin : 100px auto ; background : rgba(0,0,0,.5) ; /* 最后的.5是透明度 */ } </ style > </ head > < body style ="background: url(img/zdy.jpg);" > < div id ="wrap" > </ div > </ body > </ html >
rgba的使用,注意 background:rgba(0,0,0,.5);最后的.5是透明度
<! DOCTYPE html > < html > < head > < meta charset ="UTF-8" > < title ></ title > < style type ="text/css" > * { margin : 0 ; padding : 0 ; } #wrap { width : 300px ; height : 300px ; margin : 100px auto ; background : rgba(0,0,0,.1) ; color : #FFFFFF ; font-size : 30px ; line-height : 300px ; text-align : center ; } </ style > </ head > < body > < div id ="wrap" > 我是wrap </ div > </ body > </ html >
背景透明文字不透明、
<! DOCTYPE HTML > < html > < head > < meta http-equiv ="Content-Type" content ="text/html; charset=utf-8" > < title >无标题文档</title><style> h1{ font:100px/200px "微软雅黑"; text-align:center; text-shadow: -5px -10px ,5px 10px pink;/* text-shadow: ;中的参数 颜色 偏移量 模糊程度*/}</style></head><body><h1>尚硅谷</h1></body></html>
文字阴影 text-shadow属性,属性值分别是 颜色 偏移量(-x -y) 模糊程度
<! DOCTYPE HTML > < html > < head > < meta http-equiv ="Content-Type" content ="text/html; charset=utf-8" > < title >无标题文档</title><style>/* h1{ font:100px/200px "微软雅黑"; color: white; text-align:center; text-shadow:2px 2px 9px black; } */ h1{ font: 100px/200px "微软雅黑"; text-align: center; color: white; text-shadow: black 1px 11px 10px;}</style></head><body><h1>尚硅谷</h1></body></html>
设置文字浮雕注意运用text-shadow
<! DOCTYPE HTML > < html > < head > < meta http-equiv ="Content-Type" content ="text/html; charset=utf-8" > < title >无标题文档</title><style>/* h1{ font:100px/200px "微软雅黑"; text-align:center; color:#000; text-shadow:0 0 0 rgba(0,0,0,1); border:1px solid #000; transition:1s; } h1:hover{ color:rgba(0,0,0,0); text-shadow:0 0 100px rgba(0,0,0,0.5); } */ h1{ font: 100px/200px "微软雅黑"; text-align: center; color: black; transition: 1s;} h1:hover{ color: rgba(0,0,0,0); text-shadow: black 0 0 50px;}</style></head><body><h1>尚硅谷</h1></body></html>
使用伪类hover
原文:https://www.cnblogs.com/kfj010810/p/15005841.html
内容总结
以上是互联网集市为您收集整理的CSS3----文本新增样式全部内容,希望文章能够帮你解决CSS3----文本新增样式所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。