I use Twitter bootstrap framework for designing my Web application. When i think about responsive design is it all about designing my layout responsively or should i also think about Text box, Labels, Buttons and other components to be responsive as screen gets bigger.
And which would be the best resolutions that i should follow to create a responsive design, where i could notice all most there are number of devices that keep evolving with different resolutions every day.
Currently i have developed my app which is responsive with layouts, text box, buttons, labels and headers on all resolutions between 1024 -1439, 1440- 1659, 1660 - 1920.
and less than 1024 and Greater than 1920px.
And how should i use scaling on responsive design.
I would like to know if this is the industry standards or is there anything else should i keep in mind before developing Web Application.
Twitter's Bootstrap is responsive by default. This include all components and the grid(s).
To find your answer, please first study http://getbootstrap.com/css/#grid
Twitter's Bootstrap defines four grids. The largest grid has a max container
size of 1170px.
The large (col-lg-*) is bound by:
/* Large devices (large desktops, 1200px and up) */
#media (min-width: #screen-lg-min) { ... }
Your design requires a larger grid, for at least 1920px and up.
Where 1920x1080 seems to be an industrial standard: http://en.wikipedia.org/wiki/1080p
According Bootstrap's grid definitions, i expect you should extend the grids with a larger grid. See also:
See also Bootstrap 3 - 940px width grid?,
Twitter's Bootstrap 3 grid, changing breakpoint and removing padding
To add and extra grid, download Bootstrap's LESS files from: https://github.com/twbs/bootstrap/tree/master/less, add a extra grid() and recompile your CSS.
In grid.less replace:
//or define in variables.less
#screen-superlg: 1920px;
#screen-superlg-min: #screen-lg;
// Large screen / wide desktop
//or define in variables.less
#container-superlarge-desktop: ((1860px + #grid-gutter-width));
#container-superlg: #container-superlarge-desktop;
.container {
.container-fixed();
#media (min-width: #screen-sm) {
width: #container-sm;
}
#media (min-width: #screen-md) {
width: #container-md;
}
#media (min-width: #screen-lg-min) {
width: #container-lg;
}
/* Larger devices (HD TV, 1920px and up) */
#media (min-width: #screen-superlg-min) {
width: #container-superlg;
}
}
and add:
// Super Large grid
//
// Columns, offsets, pushes, and pulls for the hd tv device range.
#screen-lg-max: (#screen-superlg-min - 1); // define in variables.less
#media (min-width: #screen-superlg-min) {
.make-grid-columns-float(superlg);
.make-grid(#grid-columns, superlg, width);
.make-grid(#grid-columns, superlg, pull);
.make-grid(#grid-columns, superlg, push);
.make-grid(#grid-columns, superlg, offset);
}
After doing this you can use the new Super Large grid by using col-superlg-* grid column classes.
After this you should also have te extend the Responsive utilities (http://getbootstrap.com/css/#responsive-utilities) defined in less/responsive-utilities.less.
Related
Which is the better way to create a responsive website among grid, media queries, and HTML tables.
often neglected by developers when it comes to responsive websites: Typography.
Typography!
#media (min-width: 640px) { body {font-size:1rem;} }
#media (min-width:960px) { body {font-size:1.2rem;} }
#media (min-width:1100px) { body {font-size:1.5rem;} }
There are lots of ways to create a responsive behavior in css, you gave some good examples for them.
Personally, I'm using the Flexbox and Grid display methods to align html containers and contents, and by using Media Queries i can make them interact responsively for any device.
For example, if you wanna render a cards-based container, meaning there will be multiple div elements with their own contents, aligned in a straight line, i would use the flex-wrap property to break them instead of overflowing to one of the page sides. If the cards are getting small enough for the page, i'd use the vw value for my card's width at a certain page width, using media queries.
Of course you can have your own preferences for different responsive methods, and there are a lot you can search on the internet, i just gave some of my own.
Use media queries and flex,
Some example breakpoints,
// Extra large devices (large desktops, 1200px and down)
#media (max-width: 1200px) { ... }
// Large devices (desktops, 992px and down)
#media (max-width: 992px) { ... }
// Medium devices (tablets, 768px and down)
#media (max-width: 768px) { ... }
// Small devices (landscape phones, 576px and down)
#media (max-width: 576px) { ... }
how can i change the value of my "height" element when the device or width/height changes? my default height size is 180px (that's a rectangle in LG(large screen) but the height doesn't change when i try visit in mobile device (XS) mode.
i want to increase the value of "height" when someone visits website from XS or mobile devices.
i"m using bootstrap 3.3.7 in my project.
Defining Proper Media Queries
Bootstrap has clearly defined breakpoints for different kinds of
devices, specified by using CSS media queries. The following are the
breakpoint categories used for the different types of devices:
Extra Small Devices (e.g. cell phones) are the default, creating the “mobile first” concept in Bootstrap. This covers devices
smaller than 768px wide.
“Small Devices” (e.g. tablets) are targeted with #media (min-width: 768px) and (max-width: 991px) { ... }.
https://www.sitepoint.com/responsive-web-design-tips-bootstrap-css/
I understand that Bootstrap is the most popular HTML, CSS, and JavaScript framework for developing responsive, mobile-first web sites. So it helps makes the websites responsive and stuff. Currently, I have another file for css where I use media queries and re organize my css layout through that (thats how I make it responsive).
Does Bootstrap handle all media queries for me, or will I need to do additional legwork?
That's correct, all media queries are handled by bootstrap. You just need to assign the appropriate classes to your html elements.
More information on the grid system can be found here:
http://getbootstrap.com/css/#grid
You'll have to modify your html won't have to make any additional css modifications for bootstrap to work 'out of the box'
Bootstrap uses four devices sizes: XS, XM, MD, and LG. Here are the media queries that bootstrap uses. You may want to compare so that you can make sure your system is close to theres. Otherwise you may need to do a larger overhaul.
/* Extra small devices (phones, less than 768px) */
/* No media query since this is the default in Bootstrap */
/* Small devices (tablets, 768px and up) */
#media (min-width: #screen-sm-min) { ... }
/* Medium devices (desktops, 992px and up) */
#media (min-width: #screen-md-min) { ... }
/* Large devices (large desktops, 1200px and up) */
#media (min-width: #screen-lg-min) { ... }
If the average / most popular screen size width is now more than 1366px, why is bootstrap widest container (from their CDN) at max-width:1170px?
.container {
max-width: 1170px;
}
Should I not believe everything I read?
This is from many sources by the way, not the first one I came across.
The underlying reason for the question is I want to design for max width desktop use - I'll worry about tablets and phones when desktop design is finalised.
About screen resolution
According to screenresolution.org, the actual most popular resolution is 1366x768, not more.
About those 1170px
For desktop display, Bootstrap use a 1170px width, with a padding of 15px on both left/right sides :
#media (min-width: 1200px)
.container {
width: 1170px;
}
}
.container {
padding-right: 15px;
padding-left: 15px;
margin-right: auto;
margin-left: auto;
}
Quick calculation : (1366 - 1200) / 2 = 83.
The Bootstrap desktop layout keep (at least) a margin of 83px on both sides of your screen (98px if you count the padding). That's not that big, and it avoid the page to look congested. For a counter-example, Wikipedia use a 100% width layout, but many people think it's "too-much", it decrease readability.
What if I want to change this ?
You don't have to be worried about Bootstrap width. Of course you can change it.
Almost everything is set in percent in Bootstrap 3.
Have a look on Bootstrap customize & download page, you'll find a few variables useful :
Media queries breakpoints
#screen-xs-min: 480px
#screen-sm-min: 768px
#screen-md-min: 992px
#screen-lg-min: 1200px
Layout and grid system
#container-sm: ((720px + #grid-gutter-width))
#container-md: ((940px + #grid-gutter-width))
#container-lg: ((1140px + #grid-gutter-width))
#grid-columns: 12
#grid-gutter-width: 30px
#grid-float-breakpoint: #screen-sm-min
The Galaxy S4, for example, actually runs at 1080p. Put it in portrait mode and you'd think it would run the full desktop site, which sounds terrible when comparing that 5.5" screen with my 24" LCD for example. It seems the phone manufacturers have put in a "fake" resolution to the browser, possibly with some sort of "zoom". I would test on an actual device, or at least an Android emulator, to see what the behavior is. I usually get the correct site even though it has a high resolution.
It could be because the Bootstrap devs recognize that many developers won't have content prepared to go that large, and it's trivial to change the width.
How to change navbar/container width? Bootstrap 3
Bootstrap: how do I change the width of the container?
I am creating large web application using Foundation 3.0 UI framework and it have px based layout and font-sizing.
In design there is "em" based font-size/line-height and padding/margins. I want to know that Is it good option to choose "em" based font size and padding for responsive layout for smartphones?
I think the main advantage for em in terms of responsive design is the way that you can so easily change the font size for different screen sizes.
E.g. if you use media queries for large screens and small screens (say, mobiles and TV's) you're going to want to change the font size for both of them.
If you have everything sized in em's you can simply change the font-size on the body, like so:
/* For TV's (or other large screens */
#media screen and (min-width: 1800px) {
body { font-size: 1.4em; }
}
/* For mobiles */
#media screen and (max-width: 400px) {
body { font-size: 0.9em; }
}
Where as if you had everything sizes in px you've have to do a LOT more work resizing the font's.
EDIT: Using em for margins + padding may also be a good idea for a responsive layout, as I understand it, if you resize the body font size (as shown above) you'll also resize the margins + padding (making them either smaller or larger) which could also be very beneficial for a responsive design.
Yes, using em and % over px is definitely better for responsive design websites/applications, because unlike px which is an absolute value, em can be scaled depending on the resolution it's viewed at which is crucial if you want to target smartphones, tablets etc.