Responsive Email - Text breaks up on tablet view - media-queries

I tested the email on desktop and phone, but this is what one of the receivers saw on their tablet. The fonts and td are in percents, so I'm not sure why it's doing that. Any idea why this would be happening?
The media query I'm currently using is:
#media screen and (max-width: 600px)
I'm thinking that using something like this might fix it:
#media (min-width: 768px) and (max-width: 1024px) {

Related

Combining small phone media queries with bootstrap media queries

I'm using the standard bootstrap 3 media queries that use max-width, but also want to include some for smaller phones and tablets, but can't figure out how to get them both to work for their respective devices.
For example I know this will handle any most phones:
#media (max-width:767px)
But if I want to have a separate queries for say, iphone 5's like this
#media only screen and (min-device-width : 320px) and (max-device-width : 568px)
Either one or the other will work.
I've tried changing the order (as I know the later one will override the earlier one) and adding "!important" declarations, but nothing seems to work.
Int this particular instance I have series of links with a button below them and need to have the padding between them be smaller so they will all fit on a smaller screens (in this example an iPhone 5, but I'd like to have a 3rd one for iPhone 4 etc.), but not be to close together on the bigger one.
Is there an easy way to do this?
Thanks in advance for any help you can be.
Here's a rough example of what I tried for 3 different sizes.
/iPhone 4 and other small phones/
#media only screen and (min-device-width: 320px) and (max-device-width: 480px){
.topic-link h5 {
padding-bottom:12px;
}
}
/iPhone 5 and other medium phones/
#media only screen and (min-device-width: 320px) and (max-device-width: 568px){
.topic-link h5 {
padding-bottom:18px;
}
}
/iPhone 6 and other large phones/
#media (max-width:767px){
.topic-link h5 {
padding-bottom:24px;
}
}
Here's attempt number 2:
/iPhone 4 and other small phones/
#media only screen and (min-width: 320px)and (max-width: 480px) {
/iPhone 5 and other medium phones/
#media only screen and (min-width: 320px) and (max-width: 568px) {
/iPhone 6 and other large phones/
#media only screen and (min-width: 375px) and (max-width: 667px) {
I would suggest either being more specific with your rules (for example your min-device-width for iPhone 5 could be larger than the previous max and so on.), or using min-width in the manner suggested by this answer. Perhaps give this a read as well in regards to using min-width vs min-device-width.

change css property on smaller device

simple question.
I'd like to set the css property of a class, say the container's padding-top, to different values depending if I am on a xs device or on a sm device.
Any suggestions?
Sorry for the basic question.
You can use CSS media queries. Bootstrap includes media queries for specific device "breakpoints" (http://getbootstrap.com/css/#grid-media-queries) so you would override like this..
/* Small devices (tablets, 768px and up) */
#media (min-width: 768px) {
.container {
padding-top:20px;
}
}
/* Medium devices (desktops, 992px and up) */
#media (min-width: 992px) {
.container {
padding-top:40px;
}
}
Demo: http://bootply.com/NLOH2yNKnM

Stylus doesn't compile the #media (min-width) properly

I'm having a problem. I don't know why the Stylus isn't compiling the min-width properly when I'm using the media queries. For example:
#media screen and (min-width: 1400px)
is compiling:
#media screen and (undefined: 1400px)
but when I change from min to max, it works:
#media screen and (max-width: 1400px)
is compiling:
#media screen and (max-width: 1400px)
Anyone can help me?
I'm guess, that you have variable with same name (min-width). If you remove or rename it, all would be fine.

How to extend a media query with a class

I try to switch the display mode via javascript.
Assuming i have the html element with a class "display_mobile" i tried:
#media only screen and (max-width: 767px), html.display_mobile {
/* mobile mode definitions */
}
but this does not works.
Any idea how to solve this?
Like this. Media queries do not allow to use selectors in condition.
#media only screen and (max-width: 767px) {
html.display_mobile .any-definition {}
}

Bootstrap 3 Menu is not collapsing on Ipad

I am doing a project using the new updated Bootstrap 3 RC1.
There are may new features with the new Bootstrap 3 which are much different than the previous versions.
I figured most of the changes but one I can't resolve:
when the menu has many items it breaks in Ipad and other tablets becuase it doesnt get collapsed like it automatically collapsed on mobile (which is good)
I would like to know how do I "force" ipads to act like mobile and show a collapsed menu or better yet - how to collapse the menu if it has many items and on certain screens and smaller it breaks
here are screenshots of my live project:
-- Menu on Big Screens --
-- Menu on Ipad Landscape --
-- Menu on Ipad Portrait --
-- Menu on Mobile --
I simply want the ipad to act like mobile. notice that the portrait does act like mobile as far as the content but not the menu.
Please read: http://bassjobsen.weblogs.fm/twitter-bootstrap-3-breakpoints-and-grid/
The collapsing of your menu is defined in the less files. (Download the latest version from:https://github.com/twbs/bootstrap )
In variables.less you will find #grid-float-breakpoint: #screen-tablet; where #screen-tablet is 768px.
So by default your menu will collapse when the screen width is below the 768px;
The ipad landscape has a screen width of 1024px so the menu will NOT collapse. The ipad portrait screen width is 768 px so the menu will NOT collapse.
See also navbar.less:
// Responsive navbar
// --------------------------------------------------
#media screen and (min-width: #grid-float-breakpoint) {
To change this behavior you have to change the #grid-float-breakpoint b.e set to 767 and recompile your css files.
NB You also mentioned: "notice that the portrait does act like mobile as far as the content but not the menu."
You use "col-lg-" as prefix for your grid rows. "col-lg-" elements will stack below the 992px (ipad portrait) and become horizontal above 992px (ipad landscape).
Just ran into this issue as well. I suggest you visit:
Bootstrap customization
Find the field #grid-float-breakpoint and set it to the screen width after which menu should collapse. There you could use variables from previous section, namely from Media queries breakpoints to set proper points.
Also, take a moment and check through all available variables to change. Creating a well-customized Bootstrap package might save you hours of dev. work, if not more.
For those poor souls who are not using less, you would have to modify the bootstrap.css and change media queries associated with navbar that have a breakpoint of 768px to 992 px.
For example, change
#media (min-width: 768px) {
.nav-tabs.nav-justified > li {
display: table-cell;
width: 1%;
}
.nav-tabs.nav-justified > li > a {
margin-bottom: 0;
}
}
to:
#media (min-width: 992px) {
.nav-tabs.nav-justified > li {
display: table-cell;
width: 1%;
}
.nav-tabs.nav-justified > li > a {
margin-bottom: 0;
}
}
The no less implementations I found didnt work
Couldn't find the styles to make this happen on its own anywhere, ended up finding this - https://coderwall.com/p/wpjw4w
I was able to correct our issue by changing the #media (max-width: 768px) query to 767px instead. One of the links above referenced a 1px issue on iPad which breaks differently and was forcing the mobile version of the website instead.
If anyone is using the standard bootstrap.css file, I had to change it in 3 places:
around line 3780
/*changed from 768 to 992 */
#media (min-width: 992px) {
.navbar-header {
float: left;
}
}
around line 3799
/* changed from 768 to 992 */
#media (min-width: 992px) {
around line 3924
/*changed from 768 to 992 */
#media (min-width: 992px) {
I hope this helps someone :)
I had the opposite problem. On iPad the navbar was not collapsed (as expected), but the styles for a collapsed navbar were applied. I got it solved by changing the media query for the collapsed navbar adding -1 to match with $grid-float-breakpoint as follows:
#media (max-width: $screen-sm-min - 1) {
//styles for collapsed navbar (which won't show up on iPad portrait)
}