跳到主要內容

Front end 建議 CSS 知識

Front end 建議 CSS 知識

frontend 對於 css 要懂哪些,以下對於常用的開發項目列出一個列表,大家可以自己去找找答案,以及還沒有包涵在範圍內的部份。

對於大部分人,都會覺得 css 是一個很簡單的裝飾語法,也因為他沒有辦法進行邏輯判斷,沒有辦法進行程式計算(不加入 compass 的前提下)基本上他就是一個很簡單的語法,實際上在真正前端開發時,如果真的要強調於細節,強調於很多深入的部份,幾乎可以花去很大的功夫先從 html 特性,到 css 語法,甚至到如何命名等,都可以是一個很有趣的專題。

這邊先列出幾個對於一個前端工程師 front end engineer 需要了解的 css 項目,做介紹。

CSS

  • how import css style
  • css 權重, file, internal, important, inline attribute.
  • tag, id, class
  • box, inline mode
  • position, absolute, relative. 差異
  • float, clearfix
  • margin, padding 差異
  • width, height 計算方式
  • font style
  • image
  • background, and include background image
  • color, RGB, RGBA
  • font size
  • line-height
  • 基礎單位 px, em, %
  • opacity
  • z-index
  • 物件水平置中
  • media query

more CSS

  • 每一種 html tag 基本 display 屬性, span, div
  • other select, nth-child, * > , ^
  • :: pseudo, ex, ::hover, ::target
  • display, none, inline-block, table-cell …
  • parent and child relation, and position relative
  • css animation, transition
  • background image style
  • 物件垂直置中。
  • 混搭狀況下,權重覆蓋行為

more css 的部份,這邊大部分都是屬於更經驗談的部份,在實際開發中,有更多 css 的實際操作經驗,會讓自己省下許多事情,也讓自己能夠在提到某些問題的時候,可以自動腦補上去可能會發生的狀況。

這只是針對 css 的部份,事實上,還有更多更多關於 css 的問題,以及現在有

許多有趣的特效都可以利用 css 做到,對於 front end 這個工作,我們要再次強調,它根本就是一個

『坑』

留言

這個網誌中的熱門文章

[CSS] z-index 在不同瀏覽器繼承問題

今天會討論到這個課題,是因為要實做一個Popup dialog,所以我們希望的結果如下圖。 可是在IE7 卻發生了這樣的情況。 Popup不論怎麼設定z-index都無法浮在最上層,我們看一下html架構發生什麼事情。

[教學] 快快樂樂刪除CodeIgniter index.php

預設的CI網址預設都設定為index.php同一層級,因此所有的程式都必須指定index.php導向才能開始,例如 http://localhost/ci/index.php/welcome/test http://localhost/ci/welcome/test 本文將說明如何將惱人的index.php消除,還你一個漂亮的URL。 設定開始: 接下來說明如何使用rewrite方式將惱人的index.php去除。 rewrite不清楚的人,煩請先自行google 首先要先確定Apache的 mod_rewrite 有 開啟 ,如果沒有開啟請設定好之後重新啟動apache。 接著,在根目錄底下建立一個新檔案,檔名為 .htaccess ,裡面程式碼如下: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L] </IfModule> 接著到 application/config/config.php ,開啟檔案修改 $config['index_page'] = ""; 注意: /index.php/$1 要根據你目錄,例如 http://localhost/index.php ,網站根目錄為 /ci/index.php 則要寫成 /ci/index.php/$1 接著至CI目錄下,尋找 config\config.php , 修改一下裡面的檔案,修改如下: $config['index_page'] = ""; 存檔後,如此一來大功告成。 參考資料 官方網站說明

[教學] Mojito 安裝與入門,install mojito for beginner.

mojito ,最近終於從 YDN 對外公開此專案,這個套件主要用於解決前端多重裝置及瀏覽器端的問題,後端服務採取 node.js ,因此使用上必定要先準備以下幾個元素 準備素材 c++ complier git Node.js > 0.4.x NPM > 1.0.x 安裝方式 git clone git://github.com/yahoo/mojito.git cd mojito/source sudo npm install -g . npm install . 以上四個簡單的步驟,就可以把 mojito module 完整安裝到服務器上,接著就可以開始進入 mojito 的世界 使用方式 mojito 提供了完整的 command line 給開發者使用,接著先建立一個基本 hello world 專案,跟著以下步驟完成第一個專案。首先建立一個 mojito application, mojito create app hello cd hello 切換到目錄之後,再接著建立自己的 mojit,這邊的 mojit 就像是一個應用(application)可能會包含許多個獨立網站體,擁有獨立架構的 MVC ,包含內部設定等,詳細資料可以參考官方的 說明 ,建立 mojit mojito create mojit HelloMojit 輸入指令後,會看到顯示結果如下, creating mojit called 'HelloMojit' (using "default" archetype) ✔ mojit: HelloMojit created! ✔ mojito done. 接著修改 application.json 這個 mojit 設定檔案,讓剛才新建立的 hellp application 指定底下有一個 mojit -> HelloMojit ,讓應用可以去執行 mojit controller ,修改如下, [ { "settings": [ "master" ], "appPort": 8666, "specs": { ...