看板 Web_Design 關於我們 聯絡資訊
※ 引述《grence (逍遙盃)》之銘言: : 可是越來越常看到一些…不同的作法,像是 css裡寫: : .m10{margin:10px} : .m15{margin:15px} : .m30{margin:30px} : .mt10{margin-top:10px} : .mt15{margin-top:15px} : .p10{padding:10px} : 在 html裡把 class當行內樣式使用:<div class="m10 p10">content</div> : 程式套起來實在很囉嗦……完全沒有模組化的感覺, : 不能設 sideBarHead, sideBarContent, sideBarFooter, : 要分別設 font-size, width...之類「模組化」過的 css class... 對設計師而言當然只有視覺上的模組化有好處 你舉的例子也是CSS在視覺上的模組化 視覺要模組化當然是取視覺上的稱呼 只是你的例子模組到最小的單位去了。 假設css的class name只能取menu header footer這些功能上的名字 就代表網站如果要改樣式,只能從頭改寫CSS。 例如改header就要去改.header裡面的CSS 但是如果CSS是模組化的CSS,例如我先設好一個.button的樣式 要把a連結變成按鈕的樣子 就只要下(<a class="button"></a>)就好了 我甚至可以維護一份CSS有 .fancy_button .flat_button 等等 如果照你的要求功能命名,就只能用.action_link當class name 我還得自己copy paste我的button樣式庫到你的.action_link下 (註:no sass) -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 124.12.195.6