CSS Notes,cssnotes
Margin vs. Padding
Margin is on the outside of block elements while padding is on the inside. Use margin to separate the block from things outside it. Use padding to move the contents away from the edges of the block. Enter image description here:
When elements needs space between them, better to use margins. When text or an inner element needs space between the parent box and itself go for paddings.
Width & Height
When you set the width and height properties of an element with CSS, you just set the width and height of the content area. To calculate the full size of an element, you must also add the padding, borders and margins.
/* It will only have effect on the link in this page */
#this-page a:hover {
...
}
nth-child
You can actually select any child of an element after the first child with the pseudo-class selector nth-child; you just add the child's number in parentheses after the pseudo-class selector. For example,
p:nth-child(2) {
color: red;
}
would turn every paragraph that is the second child of its parent element red. The element that is the child goes before :nth-child; its parent element is the element that contains it.
Notes郵件問題,未讀取的郵件顯示為已經讀取?
重新整理一下模板就好了
我的CSS在Dreamweaver裡可以顯示但是一預覽就不行了幫我看看代碼哈
是不是因為你背景的URL用了相對本地磁碟的路徑?如果是用drewmweaver做的頁面,建議你在右邊“檔案”樹型目錄這裡建立一個網站,把網站路徑設定為你當前開發的這個站的目錄,然後再去寫CSS。這樣背景URL這裡就DW就會自動轉為相對路徑。那麼在預覽的時候就不會有問題了。
還有第一行的@charset "utf-8";看起來好象是設定UTF-8編碼,但是,我好象從來沒見過類似的定義,我做UTF-8頁面的CSS從來沒用過這個。也可能是這裡出了問題。去掉試一下吧。
-------
圖片示範那裡點管理網站。添加一個。
不添也行,如果是外聯的css,那麼url後面的路徑設定成相對css檔案所在目錄就可以了。如果內聯的,設定成該分頁檔相對的路徑。