Npcink Blog
切换菜单

简单的单按钮引导卡片 - wordpress 区块

这次分享 wordpress 区块教程和之前分享的小工具引导卡片类似,也是单按钮,响应式布局,一款简化版但按钮引导卡片,使用起来更加方便

本页目录2 节

这次分享 WordPress 区块教程和之前分享的小工具引导卡片类似,也是单按钮,响应式布局,有的站长用了之前的那款卡片后感觉太炫了,想要个简单的,这次就带来了一款简化版但按钮引导卡片,使用起来更加方便。

这款卡片长这样:

<div id="cao_widget_ads-2" class="widget widget-adss">
<div class="adsbg">
<!--背景颜色-->
<h4>Npcink</h4>
<h5>精选实用、好用的wordpress主题为你而建</h5>
<span class="btn btn-outline">查看</span>
</div>
</div>
<style type="text/css">
.widget-area .widget.widget-adss {
overflow: hidden;
padding: 0;
border-radius: 0;
}
.widget-area .widget {
position: relative;
background-color: #fff;
padding: 20px;
border-radius: 4px;
clear: both;
overflow: hidden;
}
.widget-adss .asr {
display: block;
padding: 30px 15px;
text-align: center;
color: #fff !important;
background: #64ddbb;
text-decoration: none;
border-radius: 10px;
}
.widget-adss .asr h4 {
margin: 0;
font-size: 18px;
font-weight: bold;
color: #fff;
}
.widget-adss .asr h5 {
margin: 15px 0 0;
font-weight: normal;
color: #fff;
}
.widget-adss .asr .btn {
margin-top: 20px;
font-weight: normal;
border-radius: 100px;
text-align: center;
vertical-align: top;
user-select: none;
-webkit-transition: all .3s ease-in-out;
-moz-transition: all .3s ease-in-out;
transition: all .3s ease-in-out;
padding: 4px 30px;
line-height: inherit;
}
.btn {
display: inline-block;
padding: .35rem 1.5rem;
border: 1px solid transparent;
border-radius: .1rem;
border-radius: 2px;
border-radius: 4px;
-webkit-box-shadow: 0 2px 0 rgba(0, 0, 0, .045);
box-shadow: 0 2px 0 rgba(0, 0, 0, .045);
vertical-align: middle;
text-align: center;
text-shadow: 0 -1px 0 rgba(0, 0, 0, .1);
white-space: nowrap;
font-weight: 400;
font-size: .875rem;
line-height: 1.5;
cursor: pointer;
-webkit-transition: all .2s ease-in-out;
transition: all .2s ease-in-out;
user-select: none;
}
.btn-outline {
/* color: #fff; */
background-color: transparent;
border: 1px solid #fff;
}
.btn-outline:hover, .btn-outline:focus, .btn-outline.focus {
color: #555;
background-color: #fff;
}
.btn:hover {
opacity: 0.8;
-webkit-transition: all .3s ease-in-out;
-moz-transition: all .3s ease-in-out;
transition: all .3s ease-in-out;
}
</style>

如何使用?

打开下面提供的 Demo,按下 F12 打开开发者工具,依照注释复制代码到自己需要的地方即可。(例如 HTML 小工具或者古登堡编辑器的 HTML 区块)

虽然这次分享的 WordPress 美化的卡片用起来更加的简单,但如果您会一点点的 CSS 知识,我还是推荐你使用这款卡片: