目前分類:CSS 資料彙整 (4)

瀏覽方式: 標題列表 簡短摘要

因為這次案子要求必須要一樣,該死的IE7有bug解不出來,外加:last-child、:first-child 選擇符方式不能使用,只好用jquery去解。

轉載自 http://www.java2s.com/Code/HTMLCSS/IE-Firefox/ifltIE7.htm

 

 

 

        <!--[if lt IE 7]>
            <p>
               This text is only seen by IE 6.0, IE 5.5, and IE 5.0, but not IE
               7.0.  Other browsers just ignore this altogether, since it's
               contained in HTML comments. 
            </p>
        <![endif]-->
        <!--[if IE 6]>
            <p>
                This text is only seen by IE 6.0.
            </p>
        <![endif]-->
        <!--[if gt IE 6]>
             <p>
                This text is only seen by IE 7.0.
             </p>
        <![endif]-->



last-child、first-child都是用在背景或框線,可以用來當分隔線。而最後一個元素要拿掉,才會是

選單 | 選單 | 選單       而不是      選單 | 選單 | 選單 |


以上,紀錄一下

ezcshi 發表在 痞客邦 留言(0) 人氣()

嗯,因為這個其實是因為最近Apple、Android等智慧手機快要人手一機後,眾家推廣HTML5 + CSS3 支援度,所以新一代瀏覽器都不再像以往的IE般,東不能用,西不能用。

至於還是停留在IE6的使用者我就放生了!  微軟都已經自動更新放送到IE8了你還不更新,就不要怪為什麼網頁不好看。
現在的網頁都開始大量使用png圖讓,讓網頁運用透明度效果而美觀許多。

 

再來就是CSS3的混搭選擇符的運用、jQuery的大量運用,整體網頁特效都比以往只能夠過單調的js、dhtml邁進許多。
呃,因為陰影、圓角也是這陣子才開始打算運用在我的設計內,所以沒背下來的情況都要看翻書,哈。
就把他紀錄在這裡,方便取閱啦。

 

-moz就是讓firefox用,-webkit就是讓Chrome、Safari使用。
當然如果都支援,就用border-radius囉,所以順序一定要擺最後

圓角:這個2px就是圓的半徑。

border: 1px solid #ccc;
-webkit-border-radius: 2px;
-moz-border-radius:2px;
border-radius:2px;

/* 單一角 */
/* 其他的當然就是運用 top、bottom、left、right 混搭 */

border-top-right-radius
-moz-border-top-right-radius
-webkit-border-top-right-radius

 

 

陰影:參數依序為:X偏移值、Y偏移值、柔化的半徑、顏色,可以運用負號控制左右上下。

-webkit-box-shadow: 0px 2px 3px #F2F2F2;
-moz-box-shadow: 0px 2px 3px #F2F2F2;
box-shadow: 0px 2px 3px #F2F2F2;

 

 

文字陰影:參數依序為:X偏移值、Y偏移值、柔化的半徑、顏色,可以運用負號控制左右上下。

text-shadow: 0px 1px 1px #fff;

 

其中文字陰影都可以連續疊加,但是到時後要控制得宜,不然會變很low..
幾個效果:從http://www.w3cplus.com/content/css3%E7%9A%84%E6%96%87%E5%AD%97%E9%98%B4%E5%BD%B1%E2%80%94text-shadow擷取

text-shadow: -1px -1px 0 #fff,1px 1px 0 #333,1px 1px 0 #444;

color: transparent;
text-shadow: 0 0 5px #f96;

text-shadow: 0 0 5px #fff, 0 0 10px #fff, 0 0 15px #fff, 0 0 40px #ff00de, 0 0 70px #ff00de;

 

 

順帶一提,因為W7使用者大量上升,所以可以使用微軟正黑體當作字體,會比新細明體好看。
不過當然手機使用者可能就看不到了。

font-family:"微軟正黑體";

 

 

調整透明:百分比:80%

filter: alpha(opacity=80);
-moz-opacity:0.8;
opacity:0.8;

 

 

多層背景:也就是直接,後面再接url即可,但IE使用了後會直接消失。

background:url(../images/logo.png) left top no-repeat,url(../images/logo.png) left top no-repeat; 

 

 

旋轉:因為這功能很少會用到(或許配合jQuery?),所以僅是紀錄,IE那個旋轉參數我沒有仔細去研究,其他應該看的懂是角度。

-webkit-transform: rotate(90deg);
-moz-transform: rotate(90deg);
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation = 3);

 

補充,input表單打字時有框
input:focus, textarea:focus { border:1px solid #f90; }

 

找來的-css3 transition

效果不要問,很可怕。 http://css3.bradshawenterprises.com/


-webkit-border-radius: 6px 6px 6px 6px;
-moz-border-radius: 6px 6px 6px 6px;
-o-border-radius: 6px 6px 6px 6px;
border-radius: 6px 6px 6px 6px;
-webkit-box-shadow: 0 0 3px #1D2123, inset 0 1px 1px 0 #414547;
-moz-box-shadow: 0 0 3px #1D2123, inset 0 1px 1px 0 #414547;
-o-box-shadow: 0 0 3px #1D2123, inset 0 1px 1px 0 #414547;
box-shadow: 0 0 3px #1D2123, inset 0 1px 1px 0 #414547;
-webkit-transition: all 0.2s ease-in-out;
-moz-transition: all 0.2s ease-in-out;
-o-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out;

 

 

以上,紀錄

文章標籤

ezcshi 發表在 痞客邦 留言(1) 人氣()


/* Normalizes margin, padding */
body, div, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, pre, form, fieldset, input, p, blockquote, th, td
{ margin : 0; padding : 0; }

/* Normalizes font-size for headers */
h1,h2,h3,h4,h5,h6 { font-size : 100%; }

/* Removes list-style from lists */
ol,ul { list-style : none; }

/* Normalizes font-style and font-weight to normal */
address, caption, cite, code, dfn, em, strong, th, var
{ font-style : normal; font-weight : normal; }

/* Removes list-style from lists */
table { border-collapse : collapse; border-spacing : 0; }

/* Removes border from fieldset and img */
fieldset,img { border : 0; }

/* Left-aligns text in caption and th */
caption,th { text-align : left; }

/* Removes quotation marks from q */
q:before, q:after { content :''; }


這是之前css設計書留下的資料,基本作用就是將一些可能因為瀏覽器初始值不同,而造成設計上誤差所修正的一些css。

lanc 發表在 痞客邦 留言(0) 人氣()

常用的CSS命名規則
頭:header
內容:content/container
尾:footer
導航:nav
側欄:sidebar
欄目:column
頁面外圍控制整體佈局寬度:wrapper
左右中:left right center
登錄條:loginbar
標誌:logo
廣告:banner
頁面主體:main
熱點:hot
新聞:news
下載:download
子導航:subnav
菜單:menu
子菜單:submenu
搜索:search
友情鏈接:friendlink
頁腳:footer
版權:copyright
滾動:scroll
內容:content
標籤頁:tab
文章列表:list
提示信息:msg
小技巧:tips
欄目標題:title
加入:joinus
指南:guild
服務:service
註冊:regsiter
狀態:status
投票:vote
合作夥伴:partner

註釋的寫法:
/* Footer */
內容區
/* End Footer */


id的命名:
(1)頁面結構
容器: container
頁頭:header
內容:content/container
頁面主體:main
頁尾:footer
導航:nav
側欄:sidebar
欄目:column
頁面外圍控制整體佈局寬度:wrapper
左右中:left right center

(2)導航
導航:nav
主導航:mainbav
子導航:subnav
頂導航:topnav
邊導航:sidebar
左導航:leftsidebar
右導航:rightsidebar
菜單:menu
子菜單:submenu
標題: title
摘要: summary

(3)功能
標誌:logo
廣告:banner
登陸:login
登錄條:loginbar
註冊:regsiter
搜索:search
功能區:shop
標題:title
加入:joinus
狀態:status
按鈕:btn
滾動:scroll
標籤頁:tab
文章列表:list
提示信息:msg
當前的: current
小技巧:tips
圖標: icon
註釋:note
指南:guild
服務:service
熱點:hot
新聞:news
下載:download
投票:vote
合作夥伴:partner
友情鏈接:link
版權:copyright


class的命名:
(1)顏色:使用顏色的名稱或者16進制代碼,如
.red { color: red; }
.f60 { color: #f60; }
.ff8600 { color: #ff8600; }
(2)字體大小,直接使用"font+字體大小"作為名稱,如
.font12px { font-size: 12px; }
.font9pt {font-size: 9pt; }
(3)對齊樣式,使用對齊目標的英文名稱,如
.left { float:left; }
.bottom { float:bottom; }
(4)標題欄樣式,使用"類別+功能"的方式命名,如
.barnews { }
.barproduct { }


注意事項::
1.一律小寫;
2.盡量用英文;
3.不加中槓和下劃線;
4.盡量不縮寫,除非一看就明白的單詞.


主要的 master.css
模塊 module.css
基本共用 base.css
佈局,版面 layout.css
主題 themes.css
專欄 columns.css
文字 font.css
表單 forms.css
補丁 mend.css
打印 print.css

這篇單純是整理,因為網路上相關的頗多,這邊就不細談了。

lanc 發表在 痞客邦 留言(0) 人氣()