Sponsored Link

BQ-note

 « 月の雫 | メイン | ロリポップ・10万人突破! »
2004 . 06 . 14 (CSS)

CSS(スタイルシート)カテゴリー

CSSのカテゴリーを新たに加えました。
最近スタイルシートの勉強が滞りぎみだったのでメモ(訂正あり)程度に書ければよいかなと思っています。

まぁ、ダメダメスタイルシートが多いかと思いますが、実際に使わなきゃわかんねぇよ!ってなノリで気楽に書こうかなと思ってます。

ここ2、3日でこのサイトのリニューアルをしました。その時にいきなりつまずいたことが、左寄せレイアウトからセンタリングへ大掛かりな変更をしようとしましたが、途中で面倒臭くなりあえなく断念、かなりマイナーリニューアルに留まってしまいました(/_;)

初めにここを作ったときは海外のサイトを参考にさせていただいたのですが、ソースを見よう見まねで後先考えず各ペーンをposition:absolute;(絶対位置指定)で無理やり作ってしまったことを今更ながら後悔しています。

そんなこんなで、レイアウトを一から作る時は取り合えずサイト全体のレイアウトを制御できるCSSを指定してから作り出したらよいかなと思う今日この頃。

人様に作って頂いたテンプレートや見よう見まねでCSSを使っていると、いざ変更しようとしたときに私みたいに簡単なことが案外気付かなかったりします。知ってる方にはなんじゃそれ!なんですけど・・・

例えば

・センタリング横幅固定のサンプル
#SiteLayout{
width:800px;
padding:0;
margin:0 auto;
}
注)bodyタグにtext-align:center;も指定する。ですので各スタイルには必要な箇所にalign:left;を加えないとデフォルトのalign:leftでなくなってますので気をつけて。

・センタリング横幅自由伸張のサンプル
#SiteLayout{
padding:0;
margin:0 20%;
}

たったのこれだけ・・・幅やマージンを変えれば全体のレイアウトを自由に変更できますし、センタリングでなくてもマージンを変えておいて中のレイアウトを調整しておけば後々変更しやすいかなと思います。

レイアウトって初めから「これだ!」っての決まりにくいし、そのうち飽きてもくるし。

でも、今回のリニューアルを試みた理由は、今まで他のサイトでよく見るアドセンスやアフィリエイトがコンテンツを邪魔して見苦しくずっと無視していたのですが、今回それを自ら取り入れ、いかにサイトと同化し、コンテンツを邪魔しない共存したレイアウトを・・・

と、ちょっと苦しいいい訳になってますが、まぁ要するにとても無粋な考えでのレイアウト変更だったのですぅ・・・^^;

ということで正直者に皆様の愛のクリックを・・・^^


Posted by:BQ 01:01
 このエントリーに関連ありそな本&DVD 

Trackback (0)
 URL :
 
 

Comments (12)

That boy's about as sharp as a pound of wet liver
-- Foghorn Leghorn
Celebrex http://www.cheap-celebrex-prescriptions.com

From: Celebrex Date: 04.12.18-12:42

It's kind of fun to do the impossible.
-- Walt Disney
Diet Pills http://www.discounted-diet-pills.com

From: Diet Pills Date: 04.12.18-21:53

There is a Massachusetts law requiring all dogs to have their hind legs
tied during the month of April.
Phentermine http://phentermine.se.com

From: Phentermine Date: 04.12.19-06:02

The only real way to look younger is not to be born so soon.
-- Charles Schulz, Things I've Had to Learn Over and
Over and Over
Texas Holdem http://www.texas-holdem-com.com

From: Texas Holdem Date: 04.12.20-00:51

Maier's Law:
If the facts don't conform to the theory, they must be disposed
of.

Corollaries:
(1) The bigger the theory, the better.
(2) The experiment may be considered a success if no more than
50% of the observed measurements must be discarded to
obtain a correspondence with the theory.
Texas Hold em http://www.texas-holdem-com.com

From: Texas Hold em Date: 04.12.20-11:50

What good is having someone who can walk on water if you don't follow
in his footsteps?
Poker http://www.internet-texas-holdem-poker.biz

From: Poker Date: 04.12.21-01:18

Security check: INTRUDER ALERT!
Pocker http://www.internet-texas-holdem-poker.biz

From: Pocker Date: 04.12.21-15:09

This is lemma 1.1. We start a new chapter so the numbers all go back
to one.
-- Prof. Seager, C&O 351
Poker http://www.party-poker-player.com

From: Poker Date: 04.12.22-16:58

I've given up reading books; I find it takes my mind off myself.
Tramadol http://online-prescription-pharmacy.com/Tramadol.htm

From: Tramadol Date: 04.12.23-15:45

Life, loathe it or ignore it, you can't like it.
-- Marvin, Hitchhiker's Guide to the Galaxy
Amoxicillin http://online-prescription-pharmacy.com/Amoxicillin.htm

From: Amoxicillin Date: 04.12.24-23:04

Due to lack of disk space, this fortune database has been
discontinued.
Clonazepam http://online-prescription-pharmacy.com/Clonazepam.htm

From: Clonazepam Date: 04.12.27-08:09

Everyone talks about apathy, but no one ____does anything about it.
Poker http://party-poker.player.gb.com

From: Poker Date: 04.12.28-03:04

2004. 06 17
moblog memorys »


Creative Commons License
B L O G T I M E S


page top

©2004 BQ-note.  
bqnote1@s41.xrea.com