GithubHelp home page GithubHelp logo

css-basic-mediaquery-workshop's Introduction

Responsive Design:

  1. Open the HTML file in a text editor.
  2. Create CSS file (styles.css) and link it in the <head> section of the HTML using the <link> tag.
  3. Apply default styles to the elements in the CSS (e.g., body, header, nav, main, section, footer).
  4. Add the following line inside the <head> section of the HTML to enable responsive behavior: <meta name="viewport" content="width=device-width, initial-scale=1.0">.

Mobile First approach and Media Queries:

  1. Add a media query for screens with a maximum width of 600px.
  2. Inside the media query, modify the styles of the elements to make them more suitable for mobile devices (e.g., center-align the header, stack the navigation vertically).

Typical Device Breakpoints CSS media queries:

  1. Add another media query for screens with a minimum width of 601px.
  2. Inside this media query, modify the styles of the elements to create a responsive layout for tablet and desktop screens (e.g., use flexbox to arrange the sections side by side).

CSS units (px, em, rem, vw, vh, vmin, vmax):

  1. Apply appropriate CSS units to the styles of elements in the CSS file.
  2. Adjust the font sizes, margins, and paddings using different units (e.g., rem, vw, vh).

CSS functions (calc(), min(), max(), clamp()):

  1. Utilize CSS functions to calculate values dynamically.
  2. Use the calc() function to perform arithmetic operations on CSS values (e.g., calc(1.5rem + 1vw)).
  3. Apply the clamp() function to set a range of acceptable values for a property (e.g., clamp(14px, 1.5vw, 18px)).

css-basic-mediaquery-workshop's People

Contributors

omardieh avatar

Watchers

 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.