纯css实现文字溢出阴影遮罩效果
代码语言:html
所属分类:布局界面
代码描述:纯css实现文字溢出阴影遮罩效果
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <style> * { box-sizing: border-box; } body, html { width: 100%; min-height: 100%; } body { background: #100e17; z-index: -3; position: relative; } html { background: white; font: 16px sans-serif; color: #fff; background: #100e17; } h1 { text-align: center; margin-bottom: 0px; color: #fff; } footer { margin-top: 10px; } footer a { font-weight: bold; text-decoration: none; background: -webkit-gradient(linear, right top, left top, from(#ff8a00), to(#e52e71)); background: linear-gradient(270deg, #ff8a00, #e52e71); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; } footer a:hover { background: none; background-clip: initial; -webkit-text-fill-color: initial; color: #fff; text-decoration: underline; } p { text-align: center; font-size: 20px; margin-bottom: 5px; } p.lead { font-weight: bold; color: #fff; margin-bottom: 1em; background: -webkit-gradient(linear, right top, left top, from(#ff8a00), to(#e52e71)); background: linear-gradient(270deg, #ff8a00, #e52e71); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; } p + small { margin-bottom: 15px; color: #7568a3; } hr { width: 60%; border: none; height: 1px; background: #444; margin: 20px auto; } #page { display: -webkit-box; display: flex; -webkit-box-orient: vertical; -webkit-box-direction: normal; flex-direction: column; width: 100%; min-height: 100%; -webkit-box-pack: center; justify-content: center; -webkit-box-align: center; align-items: center; padding: 20px 20px 120px 20px; } .scrollbox { display: block; width: 300px; height: 62px; min-height: 62px; margin: 10px auto 40px auto; position: relative; border: 3px solid lightsalmon; } .scrollbox .background { display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: black; z-index: -2; } .scrollbox .scrollable { display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; overflow: auto; padding: 20px; background: -webkit-gradient(linear, left top, right top, from(black), to(black)), -webkit-gradient(linear, left top, right top, from(black), to(black)), -webkit-gradient(linear, left top, right top, from(black), to(rgba(0, 0, 0, 0))), -webkit-gradient(linear, right top, left top, from(black), to(rgba(0, 0, 0, 0))); background: linear-gradient(to right, black, black), linear-gradient(to right, black, black), linear-gradient(to right, black, rgba(0, 0, 0, 0)), linear-gradient(to left, black, rgba(0, 0, 0, 0)); background: -webkit-linear-gradient(to right, black, black), -webkit-linear-gradient(to right, black, black), -webkit-linear-gradient(to right, black, rgba(0, 0, 0, 0)), -webkit-linear-gradient(to left, black, rgba(0, 0, 0, 0)); background-position: left center, right center, left center, right center; background-repeat: no-repeat; background-color: transparent; background-size: 20px 100%, 20px 100%, 20px 100%, 20px 100%; background-attachm.........完整代码请登录后点击上方下载按钮下载查看
网友评论0