Anonymous
Not logged in
Talk
Contributions
Create account
Log in
Publication Station
Search
Editing
Responsive webdesign basics
(section)
From Publication Station
Namespaces
Page
Discussion
More
More
Page actions
Read
Edit
History
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== 3. Add breakpoints === There is a limit to how flexible your layout can be. For example, a three-column layout will look great on many desktop screens will simply not fit on a phone screen. Therefore you should test what the size limit of your specific design is, and from that limit, the layout should change. This can be done with CSS media queries. To illustrate, the CSS below will create a three-column layout by default, but as soon as the user's screen is smaller than 500px, the layout will change to a single column:<syntaxhighlight lang="css" line="1"> article{ column-count:3; } @media (max-width: 500px) { article{ column-count:1; } } </syntaxhighlight>Many things can be added in this media query. Elements can be hidden on smaller screens, menus switched to dropdown menus, font-sizes can be changed and margins made smaller. You can also add multiple media queries, so that you can optimize for multiple screen sizes. This complicates the CSS quite a but, so usually just two or three media queries should suffice.
Summary:
Please note that all contributions to Publication Station are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see
Publication Station:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation
Main navigation
Main page
Printmaking Studio
Print Studio
Dig. Publishing Studio
Namespaces
Grafiwiki
Random Page
Log in
Wiki tools
Wiki tools
Page tools
Page tools
User page tools
More
What links here
Related changes
Page information
Page logs