Strange Formatting Issue with basic HTML - android

Okay, this is driving me nuts. I've been troubleshooting a formatting issue and have been stripping and stripping the code down and no explanation for what I see.
Look at the following page:
http://test.solivitahoa.com/testbig.php
VERY simple HTML. No CSS, no JS, just a table with 2 columns. If you view it on your desktop, it's fine and looks as expected. HOWEVER, if you view it in Chrome on Android (I'm running Android 8 on OnePlus 5), the first cell has text that is much smaller than the right cell even though there is no sizes specified in the code.
The formatting is as expected until the last "1234567890" is set on the first line and then it increases the font size.
What causes this? Is there a way around it?

That is od. One way to fix it is to set a fixed text size on the whole document. For example, this css fixes the issue:
body {
font-size: 12px;
}
You can consider this your font reset css.

Related

Wordpress CSS Bootstrap how to show more columns in Masonry Grid Layout

I know little about CSS, much less about Bootstrap framework.
In the main page, my theme (Jax) shows 3 post previews columns by default. It is responsive and shows only one of them when the current device is a mobile phone, for example.
With only 3 columns, it still remains a lot of unused space, so to set it to 4 columns I change this in css:
.col-md-4 {
width: 25%; /*(instead of 33,33%)*/
}
It works in desktop pc and laptop, but now, in mobile devices, it has become completely unformatted, showing a letter by row in one column, like this:
Edit: in theme's css file. I've noticed it doesn't use .col-xs, sm or lg classes, onlye .col-md-* classes. I don't know what code section I have to show to you, I'm modifying bootstrap.css code percentages, but I know the problem is in theme template css.

font-size: in p:first-letter not working right on Android chrome

There's a problem that shows up on a Nexus 7 in which font-size: isn't working properly in a p:first-letter selector.
p:first-letter {
font-size:1.3em;
font-weight:bold;
color:#662020;
}
Screen shots from the Nexus 7 Chrome below. On the left is it in landscape orientation and looks as expected with the first letter larger. On the right the same page in portrait mode. Note the first letter, "V" has become smaller than the rest of the text. I tried setting font-size:130% and it looks the same, too small.
There are also similar problems with p:first-line that are probably related. I only see these issues on Android devices.
Any clues how to fix this (some meta viewport magic or something) or a work around?
This looks like it might be Font-boosting. Chrome will look at the page and work out if it needs to boost the font-size to make the text readable, in this case there is a chance that it is boosting the copy higher than the :before font-size.
Make sure you have a viewport set: and that should limit the effect of font boosting.
If you can also provide a demo site that will help me diagnose it further
Yes, there's a known bug: http://crbug.com/253763 (feel free to star it).
I'm a little confused by your screenshots though, because when I view vijayanderson.com/bio on a Nexus 7 everything looks fine. What version of Chrome are you using (Settings > About Chrome), and what do you have Settings > Accessibility > Text Scaling set to?
This is response to #Kinlan - it's long and so I made it an answer instead of a comment.
"font-boosting" - I knew it was happening but didn't know what it was called. If you want to look at the live site it's http://vijayanderson.com/bio.
The meta viewport is a standard one:
<meta name="viewport" content="width=device-width, initial-scale=1.0">
It seems like a bug in font-boosting in that it doesn't boost p:first-letter and p:first-line. It will appropriately boost a span with enlarged font in the paragraph, so a replacing p:first-letter with a span will look right, but is not the right fix.
I do not want to disable font-boosting, I think it adds usability. Thanks for your response.

Android 2.3 browser ignoring li width in combination with CSS ellipsis

Live URL: http://www.jungledragon.org/apps/jd3/lists
I'm working on a responsive website and as I am testing it on various devices (mostly using browserstack) I'm running into an issue that seems specific to the Android 2.3 browser.
Please find below the correct rendering of what I am trying to accomplish. This is how it works and looks on almost any browser tested. What we're looking at is a list of photos, each having a caption. The caption is entered by users and can be of any length. The caption in the top left photo is very lengthy, yet as you can see it is cut off correctly, for this I am using the text-overflow:ellipsis CSS property.
This is how the same page looks on the Android browser (2.3, using browserstack to simulate a Galaxy Note):
As you can see, the top left photo takes up more than the 50% that I have set it to, and as a result the view extends the browser window. It definitely has to do with the long caption, because if I shorten it, the view does fit in nicely.
Strangely, we do see the ellipsis effect taking place, it's just that it it somehow uses more width than I specify.
The HTML structure is as follow (pseudo code):
<ul>
<li>
<figure>
<img>
<figcaption>caption here</figcaption>
</figure>
</li>
</ul>
The li element has a width of 50% applied in CSS. The ellipsis properties are set on figcaption a. As explained, the Android 2.3 browser does seem to apply the ellipsis, yet it goes beyond the 50% width that I specified. I have tried all kinds of overflow properties at all levels of the html structure, all to no avail.
As I am using this technique in various places, I'm quite eager to solve it.
Note: I'm using border-box throughout the design, although I don't think that is the issue.

Empty space under the footer in android default browser

i have experienced many times that error. There is no such error in FF and Chrome for android, but in default android browser in portratir mode, when footer is sticked to bottom part, and page content height is less than 100%. It shows white line under footer, it seems it's not any padding or margin of Body and HTML, it seems it's something other.
I can use developer tools on desctop to debug Chrome in android, but i don't know how to debug default andoird browser.
I have removed screenshot and link. Because there is no problem anymore.
Problem dissapeared after i have decreased min-width to be 980 from 1000px.
It seems min-height worked wrong in android and iphone default browsers because of wide width. For example you can took this examples of sticky footer, change min-width of body to be 1000-1040px and you will see empty space under footer.
Sticky footer example http://ryanfait.com/sticky-footer/

Android Browser resizes text automatically

I have a project that is displaying 16px text font at 0.5ems links on the iPhone perfectly fine.
However, when I switch to an Android browser, the text font enlarges itself and my positioning of the links are screwed.
My links are in a
<p><a>[Link]</a></p>
statement.
Is there any way to prevent the Android text from resizing itself? Or is there a better solution to this?
EDIT:
I just realised the android browser doesn't allow for auto scrolling as well. Why is this so? Aren't both the iPhone and Android browsers using webkits as its base? Why are they so different even though they use the same technology? Are there any extra attributes i should declare in CSS for it to work the same as the Safari counterpart?
I had a similar problem as well. I had a design that was designed specifically for the Retina display, but the retina display actually has a pixel density of 2, so a pixel isn't necessarily a pixel (non retina iphone pixel width: 320px, retina: 640px).
To fix that, I put this in the <head>: <meta name='viewport' content='width=device-width, initial-scale=.5, maximum-scale=.5'> so that a normal phone will scale as I expect, and the retina display would scale appropriately (half scale).
I'm not sure what kind of design you're using, but I'd play around with the initial-scale and maximum-scale, try both .5 and 1 and see what you get.
If you use pixels (px), it is related to the screen pixel density. An iPhone "retina" display would show text differently to your Android device.
This article covers the topic pretty well: http://kyleschaeffer.com/best-practices/css-font-size-em-vs-px-vs-pt-vs/
I found a setting that might help in another question, Font size rendering inconsistencies on an iPhone:
body {
-webkit-text-size-adjust: 100%;
}
An alternate value is described in another question, Font size issue with iPhone:
html {
-webkit-text-size-adjust: none; /* Prevent font scaling in landscape */
}
Seems like one of these might prevent the android browser from resizing. Hope this helps.
If you want to stop Android from auto-scaling your pixel values, you can try adding this to your viewport meta:
target-densitydpi=device-dpi
Here's a good reference on the same:
http://designbycode.tumblr.com/post/1127120282/pixel-perfect-android-web-ui

Categories

Resources