input width ignored on android device - android

I've created my website, but now at a mobile device (my Samsung Galaxy S4 Android phone), the contact form ignores the set width for the fields.
Part of the HTML code:
<tr>
<td valign="top">
<label for="name">Name *</label>
</td>
<td>
<input type="text" name="name" maxlength="50">
</td>
</tr>
Part of the CSS code:
input, textarea {
border-radius: 9px;
border-style: solid;
border-width: 1px;
border-color: #000000;
padding-left: 10px;
width: 450px;
}
Now everything exept for the width** works just fine, and everything including the width works on my laptop (using google chrome). My question: why does my android device (using Chrome for Android) not work?
** the width is too big for the container, which makes the submit button disappear outside of the container as well, this is because the button's float is set to right

Related

Outlook on Android (11) image size exploding

Templates that had previously worked are now exhibiting very odd behavior on Outlook for Android (11). Our logo image is strangely HUGE and wrapped in all sorts of weird ways. The actual file is 8bit, PNG, 300x79. Outlook desktop and OWA appear fine, as does iOS mail, Gmail etc. Our image code is this:
<table width="100%" role="presentation" bgcolor="#FFFFFF" cellpadding="0" cellspacing="0" border="0" style="max-width:640px;background:#ffffff !important">
<tr>
<td bgcolor="#ffffff" width="10"> </td>
<td bgcolor="#ffffff" style="padding-top:5px;">
<!--[if mso]>
<table width="50%"><tr><td>
<img width="280" src="cid:logo" style="text-align: right; width: 280px; border: 0; text-decoration:none; vertical-align: baseline;" border="0" />
</td></tr></table>
<div style="display:none;">
<![endif]-->
<img style="max-width:300px !important;height:auto;" src="cid:logo" border="0" />
<!--[if mso]>
</div>
<![endif]-->
</td>
</tr>
</table>
What we're seeing here is actually a portion of the letter "A". The orange is a 10px high orange bar that runs across the top of our emails.
I've cleared all data and cache from my Outlook mobile. No difference. Before I go any crazier, am I missing something here in this code? What's even weirded is if I change the template to just text and do not include the image (inline displayed using contentid) is Outlook on Android still shows the image as below.
Turns out it was minified CSS. When I took the exact same CSS, un-minified it and put that in the head section, Outlook mobile worked as expected. Swap back to minified and it broke again.

The virtual keyboard pushing the bottom element up in html

I have a bottom table which lies at the bottom of the webpage bottom:30px, but when I try to tap on the input boxes to provide an input the bottom table rises up along with the keyboard pops upside.
CSS code:
.progress-table {
height: 1px;
width: 100%;
border:1px;
position:absolute !important;
bottom: 30px;
}
HTML Code
<table class="progress-table">
<tbody>
<tr>
<td style="width: 60%;"><hr style="border: 2px solid #ffb414; margin-left:15px; margin-top:0px;" align="left" width="100%" /></td>
<td style="width:93%"> <div class="hr" style="padding-bottom:19.9px"></div> </td>
<td style="width: 50%; align-content:center;">
<img src="/lib/ZSLogo.png" style="width:25px; height:12px; margin-right:15px;margin-bottom:19.9px" />
</td>
</tr>
</tbody>
When the keyboard pops up
you may notice how the bar is above the text input area.
I want it to be lying where it was before the keyboard pops.
the prior image is here:Here is the image for the normal view
In short, the orange bar should not push upwards with the appearance of the keyboard.

Android 4.1 4.2 navigation tab not response ( include solution)

My application is running based on following libraries:
jQuery Version: 1.9.1
jQuery Mobile Version: 1.3.1
I made a table with 4 clickable cells:
jsFiddle example
when I build my app in Phonegap, those tabs are working fine on iOS and Android 4.4, but
doesn't work on Android < 4.4.
when click those cells, nothing happened. I have to keep the data-position="fixed" data-tap-toggle="false" as if I remove it, the tabs are collapsed.
anyone experience the same issue? Sorry if I didn't put in all codes in as it's a large project.
<div class="sortbar" data-position="fixed" data-tap-toggle="false">
<table style="background-color:#555;border:none;">
<tbody>
<tr id="tick_top_menu">
<td width="25%" onclick="alert('1')">tab1</td>
<td width="25%" onclick="alert('2')">tab2</td>
<td width="25%" onclick="alert('3')">tab3</td>
<td width="25%" onclick="alert('4')">tab4</td>
</tr>
</tbody>
</table>
.sortbar {
padding: 0px;
width: 100%;
left: 15px;
top: 64px;
height: 100px;
}
Finally, I found this is related to hardware acceleration.
by applying following CSS on that navigation div solved my problem:
.androidpaintfix {
-webkit-transform: translate3d(0,0,0);
transform: translate3d(0, 0, 0);
}

Is there a method of turning off the Gmail App's Auto-resize feature in an email's layout?

I'm laying out an email to be viewed across browsers and mobile platforms and mostly all is going well. It's laid out in tables, using inline styling etc. However, despite a media-query to the effect of a 600px max-width, the Gmail app on at least my and one other Android I have access to is opting to resize the images and layout to fit into it's area instead of using the media query or letting it fit itself into the window normally, either of which would be fine.
For personal use, I'm able to 'turn off auto-resize' on my phone, and then the email lays out as it would in a browser.
Is there a means to either tell the Gmail app not to auto-resize from the email size or to use the media query instead?
As Google does itself (sic!) here you should add a small hack on top of your template, right after your <body> tag:
<!-- Gmail hack -->
<div style="display:none; white-space:nowrap; font:15px courier; color:#ffffff; line-height:0; width:600px !important; min-width:600px !important; max-width:600px !important;"> </div>
<!-- /Gmail hack -->
Since Gmail and Inbox will ignore the display:none, the hack will affect only those two clients.
<meta name="viewport" content="width=device-width, initial-scale=1"/>
Then set the style attribute on an image (1px gif works) that spans the full width of the page (style="min-width:600px;"). Everything will be laid out correctly, and it'll be scrollable.
Gmail in general doesn't support media queries, or the style tag in general, which is why we have to move everything inline.
Inspired by css-tricks.com, this block of code solved my issue.
Place it right before </body>.
<table class="gmail-app-fix">
<tr>
<td>
<table cellpadding="0" cellspacing="0" border="0" align="center" width="600">
<tr>
<td cellpadding="0" cellspacing="0" border="0" height="1"; style="line-height: 1px; min-width: 200px;">
<img src="transparent.gif" width="200" height="1" style="display: block; max-height: 1px; min-height: 1px; min-width: 200px; width: 200px;"/>
</td>
<td cellpadding="0" cellspacing="0" border="0" height="1"; style="line-height: 1px; min-width: 200px;">
<img src="transparent.gif" width="200" height="1" style="display: block; max-height: 1px; min-height: 1px; min-width: 200px; width: 200px;"/>
</td>
<td cellpadding="0" cellspacing="0" border="0" height="1"; style="line-height: 1px; min-width: 200px;">
<img src="transparent.gif" width="200" height="1" style="display: block; max-height: 1px; min-height: 1px; min-width: 200px; width: 200px;"/>
</td>
</tr>
</table>
</td>
</tr>
</table>
(Tested with Gmail 6.0 and Inbox 1.20 on Android 5.0.1, resolution 720x1280 (works on both portrait and landscape orientation)).
I just added style="min-width:290px;" to my outer most table, which is the smallest size my responsive emails view and its stopped moveong my blocks around and doesn't auto-resize. This means in Gmail App the email shows as a whole email.
The solution that worked for me was to apply a min-width: 600px to the outermost table in my template. This worked on the Android Gmail application. (Note that my layout uses 600 pixels. Your layout might be different)

Spanned columns collapsing on Android web-browser (when using auto-fit pages)

Update: I've logged a bug report with Google - http://code.google.com/p/android/issues/detail?id=22447&can=4&colspec=ID%20Type%20Status%20Owner%20Summary%20Stars
Update: #benni_mac_b points out that the problem goes away if you disable auto-fit pages. This 'solution' works on 2.1 and 2.2 - turns out that the 2.3 phone I was testing on had disabled auto-fit to start with, and when enabled the table breaks again.
Guess I'm now looking for a way to tell Android not to auto-fit the table (and override the browser setting). Not liking my chances judging by my Google searches so far.
I've encountered an odd issue with the Android web-browser and spanned columns - for example, if I have this structure:
<table class="amhtable">
<col width="16.72%" />
<col width="16.62%" />
<col width="16%" />
<col width="16%" />
<col width="34.67%" />
<thead>
<tr class="heading">
<td>Modifying circumstance</td>
<td>Common pathogens</td>
<td>First choice</td>
<td>Alternative</td>
<td>Additional information</td>
</tr>
</thead>
<tr class="heading2">
<td colspan="5" width="100%">SECTION TITLE</td>
</tr>
<tr class="body">
<td>column 1</td>
<td>column 2</td>
<td>column 3</td>
<td>column 4</td>
<td>column 5</td>
</tr>
</table>
The spanned row will reduce to fit the size of the screen, even if the table itself is still wider. This means that the heading2 row's background is missing across most of the table in some cases, making it look quite odd.
This is not happening on iPhone, or any desktop browser (Chrome, IE, FF, Safari) that we're aware of - just on Android (multiple devices and versions).
The CSS:
.amhtable {
border-width:1px;
border-style:solid;
border-color:#000000;
border-collapse: collapse;
border-spacing: 0;
padding: 5px;
font-weight: normal;
color: #000000;
}
.amhtable td {
border-width:1px;
border-style:solid;
border-color:black;
padding: 3px;
}
.amhtable th {
border-width:1px;
border-style:solid;
border-color:#777777;
background-color:#0084D6;
}
.amhtable .heading {
border-width:1px;
border-style:solid;
border-color:#000000;
background-color:#567ac4;
font-weight: bold;
font-style: italic;
font-family: Verdana, Arial, Helvetica, DejaVu Sans, Bitstream Vera Sans, sans-serif;
}
.amhtable .heading2 {
border-width:1px;
border-style:solid;
border-color:#000000;
background-color:#82a3e7;
font-weight: bold;
font-family: Verdana, Arial, Helvetica, DejaVu Sans, Bitstream Vera Sans, sans-serif;
}
So far, I've tried the following:
Removing the <col> elements
Adding a sixth column and empty <td> elements into each row
Removing the border-collapse style ( after reading Webkit Browsers Rendering for Table Depending on colspan )
Setting the width of the spanned column to 100% (along with the changes above)
Setting a fixed width on the table and setting the spanned column to 100%
Replaced the % based widths of the columns with fixed pixel widths
Set the position to be relative for the spanned cell (and then the row) and set left and right to 0.
Set the position to be relative for the row with left as 0, and width as 1000px
Wrapped the table in a 100% wide <div>
One thing that we noticed yesterday is that the table should have a 1px black border - but there is a gap on the 2.1/2.2 devices we're testing on where the row doesn't complete. It really does seem to be a rendering problem on these devices.
I wonder if the following will help:
Wrap those body rows in a tbody element:
Remove the width="100%" from your header row. Colspan="5" should span the width of the table anyway, with the browser sizing accordingly. I wonder if the Google browser is interpreting that literally as the width of the current screen.
Add the following to the class for .amhtable:
float: left;
width: 100%;
To see if it's a relative sizing bug.
Out of interest, does this happen if the heading row appears anywhere in the table? Or is it just the first time it occurs after thead?
<table class="amhtable">
<col width="16.72%" />
<col width="16.62%" />
<col width="16%" />
<col width="16%" />
<col width="34.67%" />
<thead>
<tr class="heading">
<td>Modifying circumstance</td>
<td>Common pathogens</td>
<td>First choice</td>
<td>Alternative</td>
<td>Additional information</td>
</tr>
</thead>
<tbody>
<tr class="heading2">
<td colspan="5">SECTION TITLE</td>
</tr>
<tr class="body">
<td>column 1</td>
<td>column 2</td>
<td>column 3</td>
<td>column 4</td>
<td>column 5</td>
</tr>
</tbody>
</table>
What happens if you try that?
Other things you might try are putting the actual heading text in an element like:
<tr class="heading2">
<td colspan="5"><span style="100%">SECTION TITLE</span></td>
</tr>
Maybe it's a mistake but did you tried to put on your table :
table class="amhtable" **cellspacing="0"**
Is the total width of the columns suppose to be 100.01%?
Try reducing first column to 16.71%?
I'm not sure, but try this method http://jsfiddle.net/DhAYd/9/
The (X)HTML document in your bug report is not Valid; at best it is incomplete. A DOCTYPE declaration (HTML 4.01, XHTML 1.0) or a doctype (HTML5) is required. In the current HTML5 Working Draft, the col element does not have a width attribute (the W3C Validator says it is obsolete; you should use CSS instead). But this also cannot be Valid HTML or XHTML 1.0, as the title element is missing.
As a result of the missing DOCTYPE declaration, the layout engine is likely going into Quirks Mode, and you cannot expect interoperable behavior.
Also, percentages in (X)HTML are not specified to support decimals, although it is not explicitly forbidden. A HTML syntax validator would not catch this error as %Length is an alias for CDATA (any character data).
You should
Validate your document: W3C Validator
Make it Valid.
See if using integer percentages or CSS helps.
Only if you are still seeing different behavior, you should file a bug.

Categories

Resources