Opening HTML file as text on Android - android

The problem is:
Text from HTML file not showing on Android but showing on iOS
I have notice that there is something not showing on my page when I access it on Android devices but showing on iOS Devices. I mean that on iOS Devices only shows the text that needs to be seen by the user, but on Android it shows the whole HTML file (also including the tags).
Maybe in the HTML File is the problem.
Here is the HTML:
<div>
<p style="margin-bottom: 14pt; line-height: normal; font-size: 14pt;"><span style="font-family: Verdana;">The APP</span></p>
<p style="margin-top: 14pt; margin-bottom: 14pt; line-height: normal; font-size: 14pt;"><span style="font-family: Verdana; font-weight: bold;">Date: 12.03.2022</span></p>

Related

HTML email links in Android Outlook app turning blue

I have two links in my html newsletter that turn to the default blue no matter what I seem to do. Anyone know of any fixes.
The <span>, <font> and <strong> tags were all fixes I've read about but none seem to work.
Blue Links
a {font-family:'Roboto', sans-serif, Helvetica, Arial !important; font-size:16px; color: #EF8152 !important;; font-weight:300; text-decoration: none;}
<a href="#" style="margin:10px 0px 40px 0px; font-family:'Roboto', sans-serif, Helvetica, Arial !important; font-size:1em; color: #EF8152 !important; color: #EF8152; font-weight:300; line-height:1.0em; font-size:1em; text-align:center;">
<span style="color:#EF8152 !important; color: #EF8152;">
<font color="#EF8152">
<strong style="text-decoration: none; color: #EF8152 !important; color: #EF8152;">
View in web browser.
</strong>
</font>
</span>
</a>
This is bc of Outlook App adding styling for links. This is also an issue on Windows 10 and I believe Comcast email.
Try adding this code in your CSS
a:link, span.MsoHyperlink {
mso-style-priority:100 !important;
color:#000000 !important;
color:#000000;
text-decoration:none !important;
}
You shouldn't need all those extra tags or !important references in inline css. Something like this should work, though I get the sense you've already tried it:
<a href="#" style="margin:10px 0px 40px 0px; font-family:'Roboto', sans-serif; color: #EF8152; font-weight:300; line-height:15px; font-size:15px; text-align:center; font-weight: bold; text-decoration: none;">
View in web browser.
</a>
Two other things to try:
Get rid of the styles for a in the <head>.
If you're inlining any CSS, turn that off / don't do it.
If this still doesn't work there's been chatter about this being a bug in Outlook app, both Android and iOS apps are mentioned.

Is there a cursive font in the Android stock browsers?

As a part of offering example themes for a website, to show it is possible with LESS, I am using a cursive font-family. For example:
#base-font-family-fonts: 'Lucida Handwriting', 'Comic Sans', 'Comic Sans MS', 'Chalkboard', cursive;
I've tried naming many different cursive font, but not even the fallback "cursive" works on the stock Android browser (Samsung Galaxy S4).
Do I really need to download a font to the browser on Android? Is there not a single one built in?
Here is a JSFiddle with android safe font families and unfortunately you will see there is not a stock cursive font.
If I were you, I would use Google Fonts to make your cursive text look consistent across all browsers and operating systems though.
http://jsfiddle.net/9z3tD/
<div style="font-family: sans-serif; font-style: normal">Regular</div>
<div style="font-family: sans-serif; font-style: italic">Italic</div>
<div style="font-family: sans-serif; font-weight: bold">Bold</div>
<div style="font-family: sans-serif; font-weight: bold; font-style: italic">Bold-italic</div>
<div style="font-family: sans-serif-light; font-style: normal">Light</div>
<div style="font-family: sans-serif-light; font-style: italic">Light-italic</div>
<div style="font-family: sans-serif-thin; font-style: normal">Thin</div>
<div style="font-family: sans-serif-thin; font-style: italic">Thin-italic</div>
<div style="font-family: sans-serif-condensed; font-style: normal">Condensed regular</div>
<div style="font-family: sans-serif-condensed; font-style: italic">Condensed italic</div>
<div style="font-family: sans-serif-condensed; font-weight: bold">Condensed bold</div>
<div style="font-family: sans-serif; font-weight: bold; font-style: italic">Condensed bold-italic</div>

Select tag not properly styled on stock Android Browser

I'm trying to show two select boxes in a WebView in Android (4.2.1), but the height of them aren't the correct. In higher Android version (4.4.2) the result is correct with the same CSS. I'm using Bootstrap.
HTML code:
<div class="row col-xs-12 texto-cent barrasearch2 separacion-filas visible-xs" id="barraInbox">
<div class="col-xs-12 col-sm-6 col-md-5 ident-der">
<select size="1" name="cmd2" class="select-mod">
<option value="mg_move">Move messages to</option>
<option value="mg_copy">Copy messages to</option>
<option selected="" value="mb_change">Open mailbox</option>
</select>
...
</div>
</div>
CSS code:
.select-mod{
height: 30px !important;
font-size: 14px !important;
-webkit-appearance: menulist !important;
background-color: #fff;
line-height: 1.42857143;
}
Result in Android 4.2.1:
Correct result: (with Bootstrap CSS classes)
Thank you for advance!
It might be caused by the important marks, as usually they mess with my CSS a bit. Try a more specific path to the CSS style:
#barraInbox div select.select-mod {
height: 30px;
font-size: 14px;
-webkit-appearance: menulist;
background-color: #fff;
line-height: 1.42857143;
}
It's hard to tell without knowing what they should look like. There might be a better way to do it. Could you link an image of how it should look?
select {
height:25px;
width:100%;
border: 1px solid grey;
-webkit-appearance: listbox;
background-image: url(data:image/png;base64,R0lGODlhDQAEAIAAAAAAAP8A/yH5BAEHAAEALAAAAAANAAQAAAILhA+hG5jMDpxvhgIAOw==); /* a simple arrow img */
background-repeat: no-repeat;
background-position: right center;
padding-right: 20px;
padding-left: 5px;
}
Please try this this will work for you.

HTML text input not showing in Droid

For some reason, on a Droid, my <input type="text"> field is not showing correctly. It does not show the user what is typed until the user moves on to the next field.
I checked on some online forums and it seems that this may be a Droid internal issue. However, despite that, is there any way around it? (Note: I'm using bootstrap.js and the input field is inheriting CSS styles from it. Not sure if bootstrap plays nicely with Droid?)
Here's my HTML input fields (not sure if it matters):
<label for="firstName">First Name*</label>
<input type="text" class="requiredInput" name="firstName" value="">
<label for="lastName" class="">Last Name*</label>
<input type="text" class="requiredInput" name="lastName" value="">
Here's the CSS that applies to an field, apart from the bootstrap.js CSS:
width: 100%;
box-sizing: border-box;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-ms-box-sizing: border-box;
padding: 12px 4px;
margin-bottom: 12px;
Thanks SO!
I removed all CSS styles except margin-bottom (so that it became a very plain-looking input field) and it worked.
I had the same problem and the solution was to decrease padding top and padding bottom

Default font set on Android

Can anyone tell me what are the bundled fonts on most Android devices, specifically for web pages?
Just like Windows has their bundled fonts or Mac font lists, what are the fonts that come with most Android phones and tablets? Can anyone point to a list on the web?
I'm making web pages and want to set up my CSS to degrade gracefully from using newer fonts to just plain ol' "sans-serif" and "serif" font families. Thx.
Expanding upon Grstmo's answer:
system_fonts.xml defines mapping from font-family to actual font files. So let's try these:
<div style="font-family: sans-serif; font-style: normal">Regular</div>
<div style="font-family: sans-serif; font-style: italic">Italic</div>
<div style="font-family: sans-serif; font-weight: bold">Bold</div>
<div style="font-family: sans-serif; font-weight: bold; font-style: italic">Bold-italic</div>
<div style="font-family: sans-serif-light; font-style: normal">Light</div>
<div style="font-family: sans-serif-light; font-style: italic">Light-italic</div>
<div style="font-family: sans-serif-thin; font-style: normal">Thin</div>
<div style="font-family: sans-serif-thin; font-style: italic">Thin-italic</div>
<div style="font-family: sans-serif-condensed; font-style: normal">Condensed regular</div>
<div style="font-family: sans-serif-condensed; font-style: italic">Condensed italic</div>
<div style="font-family: sans-serif-condensed; font-weight: bold">Condensed bold</div>
<div style="font-family: sans-serif-condensed; font-weight: bold; font-style: italic">Condensed bold-italic</div>
<div style="font-family: serif; font-style: normal">Serif Regular</div>
<div style="font-family: serif; font-style: italic">Serif Italic</div>
<div style="font-family: serif; font-weight: bold">Serif Bold</div>
<div style="font-family: serif; font-weight: bold; font-style: italic">Serif Bold-italic</div>
<!-- "Droid Sans" actually gives you Roboto. -->
<div style="font-family: "Droid Sans"; font-style: normal">Droid Sans Regular</div>
<div style="font-family: "Droid Sans"; font-weight: bold">Droid Sans Bold</div>
<div style="font-family: monospace; font-style: normal">Monospace Regular</div>
http://jsfiddle.net/9z3tD/4/ =>
(tested on android 4.2)
EDIT: "Droid Sans" in the screenshot is clearly Roboto.
The config supports it but turns out the underlying file is a simlink: DroidSans.ttf -> Roboto-Regular.ttf, DroidSans-Bold.ttf -> Roboto-Bold.ttf
EDIT: It doesn't seem to matter whether I quote the family names (http://jsfiddle.net/9z3tD/9/ renders the same). CSS distinguishes between generic keywords like serif and quoted "serif" which refers to a font whose name happens to be "serif"; but the xml config makes no distinction so I guess in android either syntax refers to a font whose name is "serif". But there may be a difference if you create a custom WebView and configure it to map generic keywords to other fonts (setSerifFontFamily() and friends).
Then there are fallback_fonts.xml. These have no names; e.g. you CAN'T say font-family: "Droid Sans Fallback".
But all of them are suppossed to be tried for every missing glyph in other fonts. Presumably one can even choose a subset using font-variant of "elegant" or "compact" and by setting text lang="ja"?
However I don't see Droid Sans Fallback being used at all so perhaps fallbacks don't work in WebKit :-(
Disclaimer: The above applies to stock Android, using stock browser and/or Chrome. I believe it also applies to WebView (with default config) but haven't tested.
In theory manufacturers may use other fonts, e.g. I heard rumors Samsung does it. In practice screenshots on all android devices BrowserStack had all — including Samsungs — look to my untrained eyes to be Roboto or Droid, the differences being just android releases...
However here is Galaxy S3 caught not aliasing Georgia to serif so something differs.
Firefox is a good example of a browser doing it differently — they switched to Open Sans and Charis SIL Compact, then replaced Open Sans with Clear Sans.
The full config is in libpref/init/all.js and is language-dependent.
As far as I can tell, Firefox disregards the system_fonts.xml's aliases, e.g. Georgia results in a sans font.
OTOH, older versions (tested 30, 34) allowed you to refer to system fonts by name, even to Droid Sans Fallback but this doesn't work on FF 36, 37 (these 2 results are for http://codepen.io/cben/pen/VYgPEE, use of AdobeBlank means that when you see chars, that font was used).
See also relevant answer about fonts available to apps.
This has been answered here: How to retrieve a list of available/installed fonts in android?
There are only 3 fonts available as part of Android; normal (Droid Sans), serif (Droid Serif), and monospace (Droid Sans Mono).
From Android 4.1 you can use this for example :
font-family: sans-serif-light;
http://www.granneman.com/webdev/coding/css/fonts-and-formatting/default-fonts/#android
Apparently there's only 3 fonts you can specify on pre 4.0 android:
Droid Sans
Droid Serif
Droid Sans Mono
I guess they translate to the default CSS ones (i.e sans-serif, serif, mono)
As I have been tested for a while, there are 3 standard font-family types for WebView:
serif,
sans-serif,
monospace.
I have been loading like below with JavaScript(I have tried different combinations from http://www.w3schools.com/cssref/css_websafe_fonts.asp - table of commonly used combinations):
myWebView.loadUrl("javascript:document.body.style.fontFamily=\"Impact, Charcoal, sans-serif\";");
so, there was no difernce with below code:
myWebView.loadUrl("javascript:document.body.style.fontFamily=\"sans-serif\";");
I've got the same result. Tested on 4.2.2.
Strange but courier also works, looks like kind of monospace.
Post 4.0 Androïd uses "Roboto" Font.
You can find specs from Androïd here :
http://developer.android.com/design/style/typography.html

Categories

Resources