<div class="col-lg-1">hi</div>
<div class="col-lg-10">hi</div>
<div class="col-lg-1">hi</div>
v/s
<div class="col-xs-1">hi</div>
<div class="col-xs-10">hi</div>
<div class="col-xs-1">hi</div>
From what i'm seeing if you use .col-lg- to define the grid system in an app. For smaller screen sizes the app does not hold up. So much so, that even if you magnify the browser by ctrl +, the width becomes 100% of each .col-lg- div.
On the contrary if you use .col-xs- the behavior is as expected (great) on large screen sizes also. (so far as i've seen). Is there any drawback of using .col-xs- or .col-md- grid system for a web app? (even when it is intended for large screen sizes also)
unexpected behavior and expected behavior just because the screen size of the fiddle is smaller than .col-lg can handle. So it makes each div 100% width
The large grid (with .col-lg) only becomes horizontal with a screensize of >=1200. The extra small grid (with .col-xs) always remain horizontal (and never stack).
if you magnify the browser by ctrl +, the width becomes 100% of each
.col-lg- div.
True cause ctrl + doesn't change the screen size.
Is there any drawback of using .col-xs- or .col-md- grid system for a
web app?
No. The col-xs will be the same for all screen sizes. In fact only using col-xs makes your app non-responsive. (When you use a navbar you will also set the #grid-breaking-point to 0).
In your case the medium grid .col-md will have the same "unexpected behavior" (unexpected for you) but for an screen size of >= 992 pixels.
Related
I am using bootstrap 3 for a webapp that I am building, normally when building a website I would either want my page centered (default .container) or have it on a total page width (.container-fluid). In other words the grid system would be a vital part of building the page. With this app I am more interested in using it for everything else but if I can make it work the way I need it, it would be a huge plus.
The app that I am building now does not need the bootstrap grid perse as it has a specific use case at a minimal screen resolution, the app does not have to be scaled for tablet or even a phone.
Just to give you a mental picture, I've build a custom navigation (75px width) that is stuck to the left side of the page. What I would like to have is to have the .container grid system NOT centered but aligned to the menu on the left.
I want something like this
I know that .container-fluid technically takes care of the MOST part of so that is NOT what I am asking.
The design that I currently want to build is based on the .container centered grid and not the fluid one.
Does anyone have some tips on how to modify bootstrap to make it work the way I described?
I am first time working on responsive site in Bootstrap and I am not able to decode classes like hidden-sm or visible-md etc.
Does hidden-sm mean to hide that particular DIV?
The answer to your question is yes. If the div is added to the .hidden-sm class it will hide that particular div in a screen size of 768px.
If an element is of the class .visible-* it means it's visible for that screen size or above.
Example:
.visible-xs shows only in screen sizes <768px
.visible-sm shows only in screen sizes < 992px
.visible-md shows only in screen sizes < 1200px
.visible-lg shows in screen sizes 1200px and above
On the flip side you can accomplish the same with .hidden class with the other sizes.
If an element is of the class .hidden-* it should be hidden for that specific screen size range
Example:
.hidden-xs hides the element in screen sizes of <768px
.hidden-sm hides the element in screen sizes of 768px
.hidden-md hides the element in screen sizes of 992px
.hidden-lg hides the element in screen sizes of 1200px
hidden-xx means that make particular section hidden in a screen size of xx
You may find more information here in bootstrap documentation
http://getbootstrap.com/css/#responsive-utilities-classes
I am using this awesome Skrollr libary: https://github.com/Prinzhorn/skrollr (animations on scrolling)
So far I have this as my implementation:
<div class="band2 landing">
<div class="container">
<div id="inside" style="position:relative;height:700px" data-0="margin-top:0px" data-1000="margin-top:800px">
<img src="/static/images/snappie.png" width="280px">
<img src="/static/images/iphonehand.png" width="400px" style="float:right;margin-top:50px" data-0="margin-right:0px;" data-150="margin-right:190px" data-300="margin-right:0px;">
</div>
</div><!-- end container -->
</div><!-- end band landing -->
basically I am moving the entire "inside" div downwards when the user scrolls down. I increase the top margin by a certain amount when the user has scrolled a certain number of pixels.
While this technically works, it produces some really weird scrolling, as you can see here on the test site: http://snappiesticker.pythonanywhere.com/splash
see how the scrollbar quivers and shakes and how its hard to scroll past the yellow bar?
I feel like hard coding these pixel values is generally not the best way to go about this and will fall apart especially when using a variety of screen sizes, browsers, etc.
What is the correct way to do this? Any skrollr experts?
Instead of using margin-top, margin-right etc.
Try using the transform:translate3d(0, 0, 0).
The first two 0's are the x and y coordinates and should be adjusted to match the effect of the margins you were setting. The third 0 is the z coordinate, which should stay at 0.
This way you are killing two birds with one stone. The transform:translate property is a lot easier for the browser to handle and the 3d enables hardware acceleration. Hopefully this will smooth things out for you.
Think I'm missing the obvious here, but I have a Bookstrap 3 navbar that works great in desktop view but as I squeeze the width and it gets to tablet size rather than collapsing into the toggle menu it's jumping the menu onto two lines:
http://www.doorsets.org.uk/
I've tried reducing the text size in the navbar via a media query but that isn't solving it.
What am I missing?
Appreciate it. Thank you.
NJ
One solution might be to change the point at which the navbar collapses, you can do this by creating a customized Bootstrap and setting the #grid-float-breakpoint to a larger number.
This variable unfortunately also influences the dt and dd inside a .dl-horizontal which might be a problem.
If you want to use a media query to reduce the font-size you can use the .navbar-default .navbar-nav > li > a selector. It however needs to become 9px at the smallest viewport size to still stay on a single row which is quite unreadable.
From the Bootstrap documentation:
Overflowing content
Since Bootstrap doesn't know how much space the content in your navbar needs, you might run into issues with content wrapping into a second row. To resolve this, you can:
Reduce the amount or width of navbar items.
Hide certain navbar items at certain screen sizes using responsive utility classes.
Change the point at which your navbar switches between collapsed and horizontal mode. Customize the #grid-float-breakpoint variable or add your own media query.
It goes on to say:
Changing the collapsed mobile navbar breakpoint
The navbar collapses into its vertical mobile view when the viewport is narrower than #grid-float-breakpoint, and expands into its horizontal non-mobile view when the viewport is at least #grid-float-breakpoint in width. Adjust this variable in the Less source to control when the navbar collapses/expands. The default value is 768px (the smallest "small" or "tablet" screen).
I use Hiero, java version, because I want to create fonts for CCLabelBMFont.
However, due to my game being on retina display, my font images are big, and they require more than one page. Cocos2d only supports one.
So, essentially, how can I produce bigger pages (canvases)? I don't think Hiero has that feature.
Click on Glyph cache radio button. Then adjust Page width and Page height until it says Pages: 1. Then change the font size to the size you want. Re-adjust page width/height if the new font size increases the number of pages.
p/s: Make sure you adjust page width/height before increasing the size. Hiero will freak out if you suddenly change to a large size without changing the page width/height, and stop displaying the sample rendering. If that happens, you have to close and restart Hiero.