Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
0
Help us understand the problem. What is going on with this article?
@skillsharejp

はてなブログAMP用サンプルCSSとAMPアドセンスコード

More than 1 year has passed since last update.

コピペ可、はてなブログAMP用サンプルCSS

実際にみんなの話題で使用しているAMP用CSSです。はてなブログ記事内でシンタックスハイライト状態で掲載が一手間なのでこちらに掲載しました(笑)
実際のAMP画面はここをクリックしてご確認ください。

body {font-size:1.1em;}

.entry-content p{margin:0 0 1.5em 0;padding:0 0 0 0;}
.entry-content p a {color:#108EDE;text-decoration:underline;}
.entry-content p a:hover {background:#e0f2f1;}
.entry-content p a:visited {color:#00897b;}

/* 記事内 */
.entry-content h2{background:#108EDE;color:#fff;font-weight:700;letter-spacing:2px;padding:1.1em 1em;margin:3em 0 1em 0;font-size:1.4rem;line-height:1;position:-webkit-sticky;position:sticky;top:0;z-index:99;}
.entry-content h2::before{position:absolute;top:100%;content:'';border-style: solid;border-width: 12px 12px 0 12px;border-color: #108EDE transparent transparent transparent;}
.entry-content h3{font-size:1.3rem;padding:1rem;border-left:6px solid #108EDE;margin:2em 0 1em 0;color:#108EDE;}
.entry-content h4{font-size:1.3rem;padding:1em 0 0 0;margin:0 0 .5em 0;}
.entry-content h4::before{content:'\f029';font-family:blogicon;margin-right:.5em;color:#108EDE;}
.entry-content h5{font-size:1.2rem;padding:1em 0 0 0;margin:0 0 .3em 0;}
.entry-content h6{font-size:1.1rem;padding:1em 0 0 0;margin:0 0 .3em 0;}

blockquote{margin:1.5em 0 1em 1em;padding:1em 1em 1em 40px;background:#fff;border:1px solid #999;color:#666;border-radius:2px;}
blockquote::before{content:"\f704";font-family:blogicon;color:#999;font-size:42px;position:absolute;top:-0.5em;left:-0.4em;background:#fff;}
blockquote cite{display:block;font-style:italic;text-align:right;font-size:0.7rem;word-break:break-all;margin-top:0.6em;}
q{font-style:italic;background:#e0f2f1;margin:0 0.2em;}

.page-entry .entry-content .hatena-fotolife, .page-preview .entry-content .hatena-fotolife{
margin:0 0 0.7em 0;max-width:100%;}
.entry-content .hatena-image-left,
.entry-content .hatena-image-right{display:block;max-width:50%;}
.entry-content .hatena-image-left{margin-right:1rem;}
.entry-content .hatena-image-right{margin-left:1rem;}

.entry-content ul,.entry-content ol{margin:0 1em 1.5em 0;padding:0 0 0 0;counter-reset:my-counter;list-style:none;}
.entry-content dl{margin:0 1em 1.5em 1em;padding:0 0 0 0;}

.entry-content ul li ul,
.entry-content ul li ol,
.entry-content ol li ul,
.entry-content ol li ol{margin:0.2em 0.5em 0.5em 1em;}

.entry-content ul li,.entry-content ol li{margin:0 0 0.2em 0;padding:0 0 0 0;line-height:1.7;list-style-type:none;position:relative;}

.entry-content ul li::before,
.entry-content ul ul li::before{color:#108EDE;font-size:.8em;margin-right:0.1rem;position:relative;top:-0.2em;}
.entry-content ul li::before{content:'\25CF';}
.entry-content ul ul li::before{content:'\25A0';}

.entry-content ol li:before {
  content:counter(my-counter);counter-increment:my-counter;
  background-color:#108EDE;color:#fff;font-size:0.8rem;display:inline-block;text-align:center;height:1.5em;width:1.5em;line-height:1.5em;position:relative;top:-0.1em;margin:0 0.4em 0 0;
}
.entry-content ol ol li:before {
  content:counter(my-counter);counter-increment:my-counter;
  background-color:#80cbc4;color:#fff;font-size:0.8rem;display:inline-block;text-align:center;height:1.5em;width:1.5em;line-height:1.5em;position:relative;top:-0.1em;margin:0 0.4em 0 0.5em;
}

.entry-content pre.code{margin:0 0 1.5em 0;padding:1em;background:#444;color:#fff;}


table{margin:0em 0 1em 0;border-collapse:collapse;border:3px solid #ccc;max-width:100%;}
th{border:1px solid #ccc;padding:0.3em 0.6em;background:#eee;color:#666;}
td{border:1px solid #ccc;padding:0.3em 0.6em;}

ul.table-of-contents{border:1px solid #108EDE;padding:1.2em 1em 1em 2em;margin:0.5em 0 2em 0;position:relative;}
ul.table-of-contents li{font-size:90%;margin-bottom:0;}
ul.table-of-contents li a{text-decoration:none;}
ul.table-of-contents ul ul{display:none;}
ul.table-of-contents:before{content:"INDEX";display:inline-block;position:absolute;top:-0.6em;left:0.5em;background:#fff;padding:0 0.5em;font-weight:700;color:#333;}


.entry-content strong{background:linear-gradient(transparent 60%, #e6ee9c 0%);}
.entry-content strong.teal{background:linear-gradient(transparent 60%, #b2dfdb 0%);}
.entry-content strong.pink{background:linear-gradient(transparent 60%, #f8bbd0 0%);}

.entry-content .exlink{border:1px solid #ccc;background:#f8f8f8;padding:0.7em;margin:0 0 1em 0;position:relative;}
.entry-content .exlink a::before{content:"\f009 \0020";font-family:blogicon;}
.entry-content .exlink a{text-decoration:underline;}
.entry-content .exlink a:hover {background:#e0e0e0;}
.entry-content .exlink a:visited {color:#666;}

.entry-content .flexbox{display:-webkit-flex;display:flex;-webkit-justify-content:space-between;justify-content:space-between;}
.entry-content .flexbox span:nth-of-type(n+2){margin-left:1%;}
.entry-content .iflexbox{display:inline-flex;-webkit-justify-content:space-between;justify-content:space-between;}
.entry-content .iflexbox span{display:inline-block;max-width:49%;}

/* パンくずリスト */
#top-box{width:100%;margin:0 auto;}
.breadcrumb{font-size:0.8rem;margin-top:2em;}

CSSから関連ある箇所をコピペしただけなので不要要素あるかもしれません。見つけた場合はコメントにてお知らせください。

はてなブログAMP用アドセンスコード

アドセンス画面で生成されるコードははてなブログでは使えません(T_T)
変わりに下記をHTML編集画面で広告を表示したい箇所に貼り付けます。
<center><amp-ad layout="fixed" width="300" height="250" type="adsense" data-ad-client="ca-pub-xxxx" data-ad-slot="xxxx"></amp-ad></center>
アドセンスIDとスロットIDはアドセンス管理画面からコピペして置き換えるのを忘れずに。

0
Help us understand the problem. What is going on with this article?
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away

Comments

No comments
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account Login
0
Help us understand the problem. What is going on with this article?