Giter Club home page Giter Club logo

blog-12in12-2015's Introduction

##部落格

###OVERVIEW

  1. Users
  2. Posts
  3. Comments
  4. 依造不同頁面,顯示不同連結

###Github Repo https://github.com/mackenziechild/blog

###demo圖 demo1

###TIP:

#####references 用來參照到其他Table的外部鍵。 語法:rails g model Comment name:string body:text post:references

####依造目前不同頁面位置,顯示不同連結 <% if current_page?(root_path) %>

All Posts

<% elsif current_page?(about_path) %>

About

<% else %> <%= link_to "Back to All Posts", root_path %> <% end %>

#####使用 CSS Normalize

如果你有看過 CSS Reset 的內容,你將會發現他基本上把所有標籤的預設樣式都歸 0,尤其是針對 margin, padding, border 這幾個樣式屬性,這樣的缺點在於套用 CSS Reset 上去之後,幾乎大部分的標籤,尤其是常用的 ol, ul, li 等標籤,就必須特別再定義過才能正常運作,否則就會導致預設的 HTML 結構呈現在頁面上時無法正常閱讀。

有別於 CSS Reset 的強勢作風,也有人開發出另一種 CSS Normalize 版本,這類的 CSS 樣式表有個很大的特色就是保留原本預設 HTML 標籤的樣式,僅針對不同瀏覽器與各版本間不相容的標籤進行些微調整,盡量讓預設 HTML 標籤的樣式可以在各以在瀏覽器版本間擁有一致的呈現,如此一來,你就算使用預設標籤也能夠撰寫基本網頁,針對需要特殊處理的 HTML 定義不同的 CSS 即可。

目前在 Github 上有個 normalize.css 版本,它的 CSS Normalize 針對 HTML5 標籤進行設計,你可以同時運用在 HTML 4 與 HTML5 的網頁上,不失為有別於 CSS Reset 的好選擇。不過也請記得,CSS Normalize 與 CSS Reset 混合使用並沒什麼意義喔,二擇一即可。

http://blog.miniasp.com/post/2012/03/14/Building-Website-is-not-that-easy-DOCTYPE-and-CSS-Reset-Normalize.aspx

blog-12in12-2015's People

Watchers

James Cloos avatar Coolsea avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.