WordPress美化教程 在文章页添加加彩色渐变框

首先把下面的CSS丢到你的主题style.css样式文件内
overflow: hidden;
margin: 10px 0;
padding: 15px 15px 15px 35px;
/*border-radius: 10px;*/
box-shadow: 6px 0 12px -5px rgb(68, 110, 92), -6px 0 12px -5px rgb(204, 212, 163);
background-image: linear-gradient( 102deg, rgba(68,110,92,1) 17.4%, rgba(107,156,120,1) 49.3%, rgba(154,183,130,1) 83.4%, rgba(247,237,191,1) 110.3% );
}
/*小太阳*/
#smcos_xty {
color: #ffffff;
overflow: hidden;
margin: 10px 0;
padding: 15px 15px 15px 35px;
/*border-radius: 10px; */
box-shadow: 6px 0 12px -5px rgb(253, 223, 234), -6px 0 12px -5px rgb(215, 240, 243);
background-image: radial-gradient( circle farthest-corner at -8.9% 51.2%, rgba(255,124,0,1) 0%, rgba(255,124,0,1) 15.9%, rgba(255,163,77,1) 15.9%, rgba(255,163,77,1) 24.4%, rgba(19,30,37,1) 24.5%, rgba(19,30,37,1) 66% );
}
/*优雅紫*/
#smcos_yyz {
color: #ffffff;
overflow: hidden;
margin: 10px 0;
padding: 15px 15px 15px 35px;
/*border-radius: 10px;*/
box-shadow: 6px 0 12px -5px rgb(175, 160, 208), -6px 0 12px -5px rgba(177, 161, 207, 0);
background-image: radial-gradient( circle farthest-corner at 10% 20%, rgba(95,117,227,1) 0%, rgba(188,167,205,1) 90% );
}
/*深邃黑*/
#smcos_szh {
color: #c7c7c7;
overflow: hidden;
margin: 10px 0;
padding: 15px 15px 15px 35px;
/*border-radius: 5px;*/
box-shadow: 6px 0 12px -5px rgb(155, 170, 185), -6px 0 12px -5px rgba(177, 161, 207, 0);
background-image: radial-gradient( circle farthest-corner at 10% 20%, rgba(0,0,0,1) 0%, rgba(64,64,64,1) 90.2% );
}
/*-无边框*/
#smcos_wbk {
color: #000000;
overflow: hidden;
margin: 10px 0;
padding: 15px 15px 15px 35px;
}
#smcos_xyz a , #smcos_gll a{
color: #eeeeee;
}
#smcos_szh a{
color: #c7c7c7;
}
#smcos_xty a, #smcos_yyz a{
color: #ffffff;
}
然后把下面的代码放到你主题的函数文件functions.php
/*文本编辑自定义快捷标签按钮*/
 add_action('after_wp_tiny_mce', 'bolo_after_wp_tiny_mce');
 function bolo_after_wp_tiny_mce($mce_settings) {
 ?>
 <script type="text/javascript"> 
 QTags.addButton( 'z_mhz', '迷幻紫', '<div id="smcos_mhz">迷幻紫</div>', "" );
 QTags.addButton( 'z_xgh', '西瓜红', '<div id="smcos_xgh">西瓜红</div>', "" );
 QTags.addButton( 'z_tkzj', '天空之境', '<div id="smcos_tkzj">天空之境</div>', "" );
 QTags.addButton( 'z_xyz', '小宇宙', '<div id="smcos_xyz">小宇宙</div>', "" );
 QTags.addButton( 'z_gll', '橄榄绿', '<div id="smcos_gll">橄榄绿</div>', "" );
 QTags.addButton( 'z_xty', '小太阳', '<div id="smcos_xty">小太阳</div>', "" );
 QTags.addButton( 'z_yyz', '优雅紫', '<div id="smcos_yyz">优雅紫</div>', "" );
 QTags.addButton( 'z_szh', '深邃黑', '<div id="smcos_szh">深邃黑</div>', "" );
 QTags.addButton( 'z_wbk', '无边框', '<div id="smcos_wbk">无边框</div>', "" ); 
 function bolo_QTnextpage_arg1() {
 }
 </script>
 <?php
 }

效果预览:

迷幻紫
西瓜红
天空之境
小宇宙
橄榄绿
小太阳
优雅紫
深邃黑
无边框
© 版权声明
THE END
感觉文章不错,分享给身边的朋友吧!
点赞11赞赏
分享