html5轮播左侧文字,HTML5 卡片轮播式名言录

这篇博客展示了如何使用CSS实现一个美观的引用框设计,包括浮动元素、清除浮动、背景颜色、文字样式、图片背景以及导航箭头等细节。作者通过选择器和伪元素技巧,创建了一个具有过渡效果的作者照片和引用文字切换功能。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

CSS

语言:

CSSSCSS

确定

body {

margin: 0;

color: #444;

background: #e2e7eb;

font: 300 18px/18px Roboto, sans-serif;

}

*,

:after,

:before {

box-sizing: border-box;

}

.pull-left {

float: left;

}

.pull-right {

float: right;

}

.clearfix:after,

.clearfix:before {

content: '';

display: table;

}

.clearfix:after {

clear: both;

display: block;

}

.author-quote-wrap .author-quote,

.author-quote-wrap .author-photo:before {

top: 0;

left: 0;

right: 0;

bottom: 0;

position: absolute;

}

.author-quote-wrap {

color: #fff;

width: 100%;

overflow: hidden;

max-width: 560px;

min-height: 390px;

margin: 50px auto 0;

background: #17a0ff;

position: relative;

box-shadow: 0 16px 28px 0 rgba(0, 0, 0, .22), 0 25px 55px 0 rgba(0, 0, 0, .21);

}

.author-quote-wrap .author-quote {

display: none;

}

.author-quote-wrap .toggle-quote {

display: none;

}

.author-quote-wrap .toggle-quote:checked + .author-quote {

display: block;

}

.author-quote-wrap .author-quote a {

color: inherit;

text-decoration: none;

}

.author-quote-wrap .author-photo,

.author-quote-wrap .quote-content {

height: 100%;

position: relative;

}

.author-quote-wrap .author-photo {

width: 140px;

background-size: cover;

background-position: center;

background-repeat: no-repeat;

quotes: '\201C' '\201D' '\2018' '\2019';

}

.author-quote-wrap .author-photo.photo-a {

background-image: url(http://raw.githubusercontent.com/khadkamhn/day-007-author-quote/master/img/author-1.jpg);

}

.author-quote-wrap .author-photo.photo-b {

background-image: url(http://raw.githubusercontent.com/khadkamhn/day-007-author-quote/master/img/author-2.jpg);

}

.author-quote-wrap .author-photo.photo-c {

background-image: url(http://raw.githubusercontent.com/khadkamhn/day-007-author-quote/master/img/author-3.jpg);

}

.author-quote-wrap .author-photo.photo-d {

background-image: url(http://raw.githubusercontent.com/khadkamhn/day-007-author-quote/master/img/author-4.jpg);

}

.author-quote-wrap .author-photo.photo-e {

background-image: url(http://raw.githubusercontent.com/khadkamhn/day-007-author-quote/master/img/author-5.jpg);

}

.author-quote-wrap .author-photo:before {

content: '';

background: rgba(22, 160, 255, .5);

}

.author-quote-wrap .author-photo:after {

top: 15px;

left: 60px;

font-size: 72px;

line-height: 72px;

position: absolute;

font-family: serif;

content: open-quote;

}

.author-quote-wrap .author-photo .navigate {

left: 15px;

z-index: 10;

right: 15px;

bottom: 15px;

position: absolute;

text-align: center;

}

.author-quote-wrap .author-photo .navigate .label {

width: 15px;

height: 30px;

cursor: pointer;

position: relative;

display: inline-block;

}

.author-quote-wrap .author-photo .navigate .label.left {

left: -30px;

}

.author-quote-wrap .author-photo .navigate .label.right {

right: -30px;

}

.author-quote-wrap .author-photo .navigate .label.disabled {

cursor: not-allowed;

}

.author-quote-wrap .author-photo .navigate .label:before,

.author-quote-wrap .author-photo .navigate .label:after {

content: '';

height: 2px;

width: 15px;

background: #ccc;

position: absolute;

}

.author-quote-wrap .author-photo .navigate .label:before {

top: 62%;

}

.author-quote-wrap .author-photo .navigate .label:after {

bottom: 62%;

}

.author-quote-wrap .author-photo .navigate .label.left:before,

.author-quote-wrap .author-photo .navigate .label.right:after {

-webkit-transform: rotate(45deg);

-ms-transform: rotate(45deg);

transform: rotate(45deg);

}

.author-quote-wrap .author-photo .navigate .label.right:before,

.author-quote-wrap .author-photo .navigate .label.left:after {

-webkit-transform: rotate(-45deg);

-ms-transform: rotate(-45deg);

transform: rotate(-45deg);

}

.author-quote-wrap .author-photo .navigate .label.left:before,

.author-quote-wrap .author-photo .navigate .label.left:after {

left: 0;

}

.author-quote-wrap .author-photo .navigate .label.right:before,

.author-quote-wrap .author-photo .navigate .label.right:after {

right: 0;

}

.author-quote-wrap .author-photo .navigate .label.disabled:before,

.author-quote-wrap .author-photo .navigate .label.disabled:after,

.author-quote-wrap .author-photo .navigate .label.disabled:hover:before,

.author-quote-wrap .author-photo .navigate .label.disabled:hover:after {

background: #bbb;

}

.author-quote-wrap .author-photo .navigate .label:hover:before,

.author-quote-wrap .author-photo .navigate .label:hover:after {

background: #fff;

}

.author-quote-wrap .quote-content {

padding: 15px;

width: calc(560px - 140px);

}

.quote-content .quote-like {

font-size: 12px;

font-weight: 400;

padding: 4px 8px;

border-radius: 15px;

display: inline-block;

background: rgba(0, 0, 0, .2);

}

.quote-content .quote-like .love {

width: 18px;

height: 10px;

position: relative;

display: inline-block;

}

.quote-content .quote-like .love:before,

.quote-content .quote-like .love:after {

top: 0;

left: 7px;

content: '';

width: 7px;

height: 12px;

background: #fff;

position: absolute;

-webkit-transform: rotate(-45deg);

-ms-transform: rotate(-45deg);

transform: rotate(-45deg);

-webkit-transform-origin: 0 100%;

-ms-transform-origin: 0 100%;

transform-origin: 0 100%;

border-radius: 20px 20px 0 0;

}

.quote-content .quote-like .love:after {

left: 0;

-webkit-transform: rotate(45deg);

-ms-transform: rotate(45deg);

transform: rotate(45deg);

-webkit-transform-origin: 100% 100%;

-ms-transform-origin: 100% 100%;

transform-origin: 100% 100%;

}

.quote-content .quote-text,

.quote-content .quote-author {

text-transform: uppercase;

}

.quote-content .quote-text {

font-size: 48px;

font-weight: 900;

line-height: 55px;

}

.quote-content .quote-author {

bottom: 15px;

font-size: 14px;

font-weight: 500;

position: absolute;

}

.quote-content .quote-author:before {

content: '- ';

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值