以CSS的display table堆疊

With responsive design, one of the things that we often want to do is to change the stack order of certain elements, moving the aside on the left below the main text which we want to bring to the top. CSS3‘s Flexbox will do this for us, but there is a quicker, if dirtier, way which we can use now.

I say “use now” when of course we can use Flexbox now but implementations vary across browsers as does the required syntax. Opera’s Chris Mills has written two excellent in-depth articles (Flexbox basics and Advanced cross-browser flexbox) on the different flavours of Flexbox.

Flexbox will of course offer more than simple re-stacking of elements, but if that is all you need, you can look no further thanCSS‘s display property.

(Incidentally this idea is based on something Bruce Lawson told us at beyond tellerand 2012)

Let’s take four boxes whose very simple HTML is laid out as follows:

reset 還是 normalize CSS?

CSS: reset or normalize?

Building for the web can be like building on quicksand. Browsers have tended to do mostly the same thing, but have occasional, maddeningly unpredictable differences. For example, browsers all come with “user agent stylesheets” — a default set of CSS styles, so that a heading looks like a heading etc., even before you style the page1. Of course, every browser engine uses a slightly different set of defaults.

Pure CSS

A set of small, responsive CSS modules that you can use in every web project.

pure-css

SCSS入門筆記

什麼是 SASS ?

Syntactically Awesome Stylesheets 語法很棒的樣式表 SASS是css3的擴充,增加了變數巢狀繼承函式等功能 

淺談 section 運用以及與 outline 間的關聯

HTML5 正夯? 恩,其實夯很久了!而 HTML5 絕對不只有語意那麼簡單罷了,它包含了很多前端的新功能與新技術,語意只是其中的一小小小塊。

今天要跟大家分享的是<section>標籤,網路上有很多關於<section>的解說,常見的文章是拿來跟<article>比較,可是我看了很多篇都似懂非懂…,所以又跑去看了國外的文件。從今年開始,我寫的 HTML 會漸漸從 XHTML 的 !DOCTYPE 走向符合 HTML5 的 !DOCTYPE,也就是在 HTML5 DOCTYPE 文章提到的<!DOCTYPE html>

隨著 HTML5 的規格釋出,語意會是我優先嘗試的部份,從整個網頁結構以及 SEO 來看,語意是 HTML5 的必備基礎知識,所以我們就先從<section>開始吧!

Bottom B

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Module Class Suffix style-box badge-hot

Bottom B

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Module Class Suffix style-box color-color1 badge-new

Bottom B

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Module Class Suffix style-box color-transparent badge-free

Bottom B

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Module Class Suffix style-box color-color2 badge-top