第一篇、自定义博客园的css样式并让其支持响应式

css文件:

<style type="text/css">
    #cnblogs_post_body
    {
        color: black;
        font: 0.875em/1.5em "微软雅黑" , "PTSans" , "Arial" ,sans-serif;
        font-size: 16px;
    }
    #cnblogs_post_body h1
    {
        background: #2B6695;
        border-radius: 6px 6px 6px 6px;
        box-shadow: 0 0 0 1px #5F5A4B, 1px 1px 6px 1px rgba(10, 10, 0, 0.5);
        color: #FFFFFF;
        font-family: "微软雅黑" , "宋体" , "黑体" ,Arial;
        font-size: 17px;
        font-weight: bold;
        height: 25px;
        line-height: 25px;
        margin: 15px 0 !important;
        padding: 5px 0 5px 20px;
        text-shadow: 2px 2px 3px #222222;
    }

@media screen and (min-width: 1px) and (max-width: 800px)
    {
        #mytopmenu
        {
            margin-left: 0;
            margin-right: 0;
            width: 100%;
        }
        #centercontent
        {
            padding-left: 0;
            padding-right: 0;
            width: 100%;
        }
        #leftcontent
        {
            width: 100%;
            position: static;
            width: 100%;
        }
        #footer
        {
            margin: 0;
            width: 100%;
        }
        #comment_form
        {
            display: none;
        }
        #header
        {
            display: none;
        }
        #green_channel
        {
            display: none;
        }
        #centercontent img { width: 98% !important; }
    }

</style>

 

页首代码:

<script type="text/javascript">
var meta = document.createElement('meta');
meta.setAttribute('name', 'viewport');
meta.setAttribute('content', 'initialwidth=device-width,initial-scale=1');
document.getElementsByTagName('head')[0].appendChild(meta);

</script>

 

转载于:https://www.cnblogs.com/HJQ2016/p/5931873.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值