GithubHelp home page GithubHelp logo

tommyfu / responsive-web-design-tricks Goto Github PK

View Code? Open in Web Editor NEW
13.0 2.0 2.0 10 KB

Responsive web design sample and guide.

Home Page: https://juejin.im/post/5a22d0086fb9a0451a7631ee

License: MIT License

HTML 100.00%
autolayout css flexbox grid

responsive-web-design-tricks's Introduction

responsive-web-design-tricks

1. float, float: left|right

try it yourself

2. inline block, display: inline-block

try it yourself

float vs inline-block

  • Float need to clear, no vertical centering
  • Inline-block white space collapse issue
  • Float or inline-block. it depends on your preference

3. flexible box, display:flex

try it yourself

Flex vs float / inline-block

  • Flex could be a replacement for float and inline-block
  • Flex has vertical centering and equal heights
  • Horizontal only vs Both Horizontal and Vertical
  • There are multiple ways to do the same thing with flexbox
  • Complex syntax and not supported by older browsers with flexbox

Can I use flex ?

4. grid, display:grid

try it yourself 1

try it yourself 2

Grid vs Flex

  • One dimensional vs Two dimensional
  • Major layouts(Grid) vs UI elements(Flex)
  • Grid is easier to learn and to use
  • Grid has a bit less browser support.

Can I use grid ?

responsive-web-design-tricks's People

Contributors

tommyfu avatar

Stargazers

gbhipolito avatar 王吉 avatar SophiaYang_SPR avatar Ajith PG avatar  avatar makeng avatar Rosa Talía Colunga Tello avatar mtpdx avatar Mitch Conover avatar allen1123 avatar  avatar Jim avatar 于斯人也 avatar

Watchers

Mitch Conover avatar  avatar

Forkers

kelly-zh

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.