

实现Google Blogger的自适应设计
source link: https://www.williamlong.info/archives/5765.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

实现Google Blogger的自适应设计
目前的网站大多数都支持手机访问,使用较多的技术是自适应设计,Google Blogger做为一个年代很久的建站平台,对自适应的支持并不是太好,这里就介绍一下如何修改模版使得Google Blogger能够支持自适应设计。
方法一:使用Google Blogger自适应模版
这种方法是最简单的,Google Blogger曾经推出了四款自适应模版:Contempo、Soho、Emporio、知名,我们只要使用这四款模版即可支持自适应。不过,这四款模版可能并非人人喜欢,如果想用其他模版的话,就要进行手动修改。
方法二:自定义修改Google Blogger模版
对于老的Google Blogger模版,通常只能使用这种方法。
进入Blogger的后台,点选左边功能中的“主题背景”,再点页面里的“修改HTML”。
在HTML头部增加如下一行代码。
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
搜索HTML,寻找width关键字,将使用绝对宽度的样式名找到。
搜索HTML,寻找padding-right,padding-left关键字,将使用这个的样式名找到。
Blogger后台点左侧“布局”,在底部添加“HTML/JavaScript”小工具。在博客中添加支持自适应的样式代码。
不同的Blogger模版,样式名略有一些不同,下面是一段示例代码。
<style type="text/css">
@media screen and (max-width:768px) {
body {min-width: 100%;width: 100%;}
.content-outer, .content-fauxcolumn-outer, .region-inner {min-width: 100%;max-width: 100%;width: 100%;}
.main-inner .columns {padding-left: 0;padding-right: 0;}
.main-cap-top .cap-left {display:none;}
.column-right-outer {width: 100%;}
#layout .content-outer {width: 100%;}
.column-right-outer {display:none;}
.column-right-inner {display:none;}
.footer-outer {display:none;}
}
</style>

</div
Recommend
-
79
-
59
摄影圈子里的「器材党」通常泛指热衷于讨论器材的爱好者群体。无独有偶,技术社区里也有一类以掌握某个开发框架为骄傲的程序员。你还别说,这两个群体还真的挺像的……
-
39
Google Blogger十大SEO优化技巧 2019-7-15 9:14:55 | 作者: 月光 | 分类:
-
42
删除Google Blogger的默认CSS和JS 2019-11-19 22:31:34 | 作者: 月光 | 分类:
-
14
Google's Blogger fails at providing web content Blogger is one of Google's properties. It seems the need to change things runs deep over there, since there has been a fundamental change to some of their pages which renders them u...
-
12
Facebook Will Now Let Users Transfer Posts and Notes to Google Docs, Blogger and Wordpress Facebook is adding more ways for users to maintain control of their on-platform data, with a
-
7
Google Adsense Approval Guidelines for blogger in 2021 Sep 19 ・1 min read
-
9
Google Blogger API - can not create a publication advertisements I am using Google Blogger API to create posts programmatic...
-
3
谷歌一直推荐响应式网页设计 (RWD),尤其是在 2015 年 4 月 21 日推出
-
6
Google Blogger翻页功能的定制修改 2022-9-24 15:56:44 | 作者: 月光 | 分类:
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK