天宮です。
さあ、いよいよ「Vaster2」テンプレを
CSS編集しカスタマイズしていきます。
まずは、ココまでの現状での表示を確認
Bloggerテンプレート「Vaster2」を
カスタムしてブログデザインを変えるとき
HTML/CSS初心者が気を付けるべきなのは
いきなり多くを望まないということ、
訳わからないソースコードを目にすると
拒否反応をしめすのが普通の人です(笑)
できそうな部分を最小限イジる感じで
デザイン変更していきましょう。
それでは、私がやってる方法での
CSS変更の基本的な流れを紹介しておきます。
CSSをバックアップし編集データを作る
HTML/CSSの編集環境を用意しよう
ダウンロードしたテーマを開いてみよう
<!--CSS-->
<b:skin><![CDATA[/*
---------------------------
Blogger Template Style
Name: Vaster2
Designer: Toumasu
URL:www.vaster2.com
------------------------- */
点線内は著作者表示です
どこに何を書いてあるのかスクロールして
探すのは大変だから、
エディターの検索機能を使うのが
基本と考えてください。
キーボードの〔Ctrl+F〕で
検索窓を表示させるとラクです。
テーマを編集してみよう
body{
font-size:18px;
color:#000000;
}
body{font-size:18px;color:#000000;}
全体の文字のフォントを編集
body{
font-family:Helvetica,"游ゴシック","Yu Gothic",sans-serif;
background-color: #fff; /* 全体の背景色 */
margin:0;
font-size:16px;
line-height:1.6em;
}
body{
font-family:'游ゴシック Medium', '游ゴシック体', 'Yu Gothic Medium', YuGothic, 'ヒラギノ角ゴ ProN', 'Hiragino Kaku Gothic ProN', 'メイリオ', Meiryo, 'MS Pゴシック', 'MS PGothic', sans-serif;
background-color: #fff; /* 全体の背景色 */
margin:0;
font-size:16px;
line-height:1.6em;
}
フォントというのはブログを見ている人の
PC/スマホの環境によりどのフォントで
表示されるのかが異なりますから、
それぞれのデバイス向けに多くのフォントを
設定しているカタチになります。
ヘッダー余白の調整とレスポンシブ対応
- ヘッダー上部の青い線を消す
- ヘッダー画像の上下余白をなくす
- ヘッダー画像を画面幅いっぱいに表示
- ブログタイトル文字の色・位置を変更
イジッて表示確認して良さ気に見たらOK
ヘッダー上部の青い線と上下余白を消す
.Header{
width:100%;
background-color:#fff;
}
#header-inner{
width:1040px;
margin:0 auto;
}
続いてヘッダーを画面幅いっぱいに表示します。
#header-inner{
width: 100% !important;
background-size: cover !important;
background-position: center !important;
margin: 0 auto;
}
#header-inner{
width:auto;
margin:0 auto;
padding-left:20px;
padding-right:10px;
}
#header-inner{
width:95%;
margin:0 auto;
padding:20px 0 50px 0;
min-height: 100% !important;
}
ブログタイトル文字の色・位置を変更
/* ブログタイトル
------------------------------------- */
.titlewrapper{
padding: 25px 10% 0 10%; /* ブログタイトル文字位置変更 */
}
.header h1{
margin-top: 0;
margin-bottom: 0;
}
.header-title a{
font-size: 40px !important;
font-weight: 700;
text-decoration: none;
color: #000;
}
.header-title a:hover{
text-decoration: none;
}
.header-title a:visited{
color:#000;
}
.header-title a{
font-size: 40px !important;
font-weight: 700;
text-decoration: none;
color: #000;
}
.header-title a:hover{
text-decoration: none;
}
.header-title a:visited{
color:#000;
}
/* ヘッダー画像を挿入した場合のタイトル文字 */
#header .title a{
font-size: 36px !important;
font-weight: 700;
text-decoration: none;
color: #000;
}
#header .title a:hover{
text-decoration: none;
}
#header .title a:visited{
color: #000;
}
/* ブログ説明 */
.header-description p{
font-size: 13px;
margin-top: 5px;
padding: 0 10%;
}
/* レスポンシブデザイン
--------------------------------------------------- */
@media screen and (max-width: 768px){
#header .title a{
font-size: 20px !important; /* ブログタイトル文字サイズ */
}
.titlewrapper{
padding: 0 10px;
text-align: center; /* ブログタイトル文字を中央寄せ */
}
.header-description p{
padding:0 10px;
text-align: center; /* ブログ説明の文字を中央寄せ */
}