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%;
}
たったのこれだけ・・・幅やマージンを変えれば全体のレイアウトを自由に変更できますし、センタリングでなくてもマージンを変えておいて中のレイアウトを調整しておけば後々変更しやすいかなと思います。
レイアウトって初めから「これだ!」っての決まりにくいし、そのうち飽きてもくるし。
でも、今回のリニューアルを試みた理由は、今まで他のサイトでよく見るアドセンスやアフィリエイトがコンテンツを邪魔して見苦しくずっと無視していたのですが、今回それを自ら取り入れ、いかにサイトと同化し、コンテンツを邪魔しない共存したレイアウトを・・・
と、ちょっと苦しいいい訳になってますが、まぁ要するにとても無粋な考えでのレイアウト変更だったのですぅ・・・^^;
ということで正直者に皆様の愛のクリックを・・・^^
このエントリーに関連ありそな本&DVD 
That boy's about as sharp as a pound of wet liver
-- Foghorn Leghorn
Celebrex http://www.cheap-celebrex-prescriptions.com
It's kind of fun to do the impossible.
-- Walt Disney
Diet Pills http://www.discounted-diet-pills.com
There is a Massachusetts law requiring all dogs to have their hind legs
tied during the month of April.
Phentermine http://phentermine.se.com
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
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
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
Security check: INTRUDER ALERT!
Pocker http://www.internet-texas-holdem-poker.biz
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
I've given up reading books; I find it takes my mind off myself.
Tramadol http://online-prescription-pharmacy.com/Tramadol.htm
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
Due to lack of disk space, this fortune database has been
discontinued.
Clonazepam http://online-prescription-pharmacy.com/Clonazepam.htm
Everyone talks about apathy, but no one ____does anything about it.
Poker http://party-poker.player.gb.com


page top