Image on Mobile won't display - android

I've built a website for a friend and it works great on computer browsers, but on mobile it doesn't display for ONE image (The other images work fine).. This is at least on the iPhone browser and Samsung Galaxy 4 browser. On a Nokia phone the image displays fine.
I actually built this website on top of another designers work, but as far as I can tell there is no specific javascript embedded anywhere for mobile browsers.
The following HTML and CSS correspond to the image that doesn't show:
<div id="main-content-left-container">
<ul id="left-bullets">
#Some bullets
</ul>
<img id="ups-map" src="./images/ups-map.jpg"> #Problem here
</div>
#ups-map {
display: block;
margin: 20px auto;
height: 200px;
width: 280px;
}
#ups-map:hover {
height: 300px;
width: 400px;
}
img {
max-width: 100%;
height: auto;
width: auto\9;
}
Does anyone have any ideas as to what this could be caused by?

Try this: http://jsfiddle.net/rvf9R/
<div id="main-content-left-container">
<ul id="left-bullets">
<li>bullet</li>
<li>bullet</li>
<li>bullet</li>
<li>bullet</li>
</ul>
<div id="ups-map">
<img src="http://pittsburghjedi.com/wp-content/uploads/2012/09/LOG-ren-and-stimpy-1552749-1280-1024.jpg" />
</div>
</div>
<style>
img { max-width: 100%; }
#ups-map {
display: block;
margin: 20px auto;
height: 200px;
width: 280px;
}
#ups-map:hover {
height: 300px;
width: 400px;
}
</style>

Related

overflow:hidden on position:relative/absolute workaround android 4.1

This is my first question, sorry if I made something wrong.
Well I'm trying to create a rounded button that dynamically "fills" according to a parameter. I've created an inner div inside the button, absolute positioned in the bottom. It works perfect on chrome webview, but I cant make it work on android 4.1.
here is how it should look:
right
and this is how it looks on android 4.1:
wrong
This is my code:
<div class="col" style="padding:0px; margin: 0px; text-align:center; height:100%">
<a style="overflow:hidden; padding: 0px; height:125px; width:125px; border-radius: 50%; border-width:2px; background-color:rgba(255,255,255,0.0001); z-index: 2" class="button likebuttons" ng-click="voteClick(1, vote.id, thread.id) " ng-class="{'button-dislike':var==1}">
<img style="margin:27px ; vertical-align:middle; position:relative; z-index: 1 ; width:60%; height:60%" src="img/thumbs-down.png" align="middle"></img>
<div style="-webkit-transition: all 0.9s ease-in; height:{{(thread.get('ratio'))*100}}%; position:absolute; bottom:0; width: 100%;background-color:#db0000"></div>
</a> </div>
The "button" class is position:relative and the other classes just add a different border color.
I've tryed everything I could find with no success...
Thanks!
You need to change the block formating context of <a> and set it to relative position too:
<div class="col" style="padding:0px; margin: 0px; text-align:center; height:100%">
<a style="display:inline-block;position:relative;overflow:hidden; padding: 0px; height:125px; width:125px; border-radius: 50%; border-width:2px;border:solid; background-color:rgba(255,255,255,0.0001); z-index: 2" class="button likebuttons" ng-click="voteClick(1, vote.id, thread.id) "
ng-class="{'button-dislike':var==1}">
<img style="margin:27px ; vertical-align:middle; position:relative; z-index: 1 ; width:60%; height:60%" src="img/thumbs-down.png" align="middle"></img>
<div style="transition: all 0.9s ease-in; height:62.5%; position:absolute; bottom:0; width: 100%;background-color:#db0000"></div>
</a>
</div>
added :
a {
display:inline-block;
position:relative;
}
Do not mind the webkit prefixe not needed anymore or use last the non prefixed rules (transition)

CSS div overlay tag works fine in Chrome on desktop, but not in Chrome on Android

I have a simple overlay <div> tag which puts some text on top of an image. Here is the HTML code:
<div class="single_image">
<div id="example-1" class="thumbs">
<a href="images/photos/01/DSC05689.jpg">
<img src="images/m1.png" alt="">
</a>
</div>
</div>
<div class="overlay">Tap to view</div>
</div>
This is what the code looks like in Chrome browser on a desktop machine:
But if I open the page in Chrome on Android, the text falls down below the image and this is what I get:
This is my CSS:
.overlay {
pointer-events: none;
position: absolute;
top: 25px;
right: 50px;
width: 200px;
height: 25px;
color: #fff;
text-decoration: none;
text-transform: uppercase;
}
What could be the cause of this?
It seems to have been an issue with browser cache. If I opened the page on an incognito tab on Android, it worked as expected.

Why is overflow:hidden not working on android tablet?

html chrome on pc
<div id="opening_0" style="background-color: #bfbfbf; position: absolute; left: 56.25px; top: 63.75px; height: 97.5px; width: 67.5px; overflow: hidden; z-index: 6; border-radius: 50% " ondrop="drag_drop_drop(event, this)" ondragover="drag_drop_allow_drop(event)" onclick="photos_add_selected_fid(this);">
<img src="system/photo/cf_preview/98f4fddef8c79235b534de4d303b2713" width="341" height="256" style="left: 0px; top: 0px; position: relative;" class="ui-draggable">
</div>
html default browser on html tablet
<div id="opening_0" style="background-color: #bfbfbf; position: absolute; left: 56.25px; top: 63.75px; height: 97.5px; width: 67.5px; overflow:hidden; z-index: 6; border-radius: 50%" ondrop="drag_drop_drop(event, this)", ondragover="drag_drop_allow_drop(event)" onclick="photos_add_selected_fid(this);">
<img src="system/photo/cf_preview/98f4fddef8c79235b534de4d303b2713" style="left:0px; top:0px; position: relative;" width="341" height="256" class="ui-draggable">
</div>
EDIT: I had a typo for the second overflow tag (I had to type the source code in manually from the tablet to here). When I fixed that, both jsfiddle's showed the image as expected, however, the android tablet still is not.
This is what it looks like on the tablet:
There is a typo in the second code snippet(html tablet)
Overflow property is set to hiden.
<div id="opening_0" style="position: absolute; left: 56.25px; top: 63.75px; z-index: 6;" ondrop="drag_drop_drop(event, this);" ondragover="drag_drop_allow_drop(event);" onclick="photos_add_selected_fid(this);">
<div id="2_opening_0" style="overflow: hidden; border-radius: 50% ">
<div id="3_opening_0" style="background-color: #bfbfbf; height: 97.5px; width: 67.5px; ">
<img src="/system/photo/cf_preview/98f4fddef8c79235b534de4d303b2713" width="341" height="256" style="position: static; margin-left: 0px; margin-top: 0px;" class="ui-draggable">
</div>
</div>
</div>
I basically had to create 2 more divs inside the opening_0 div. The tablet didn't like positioning other than static in the image tag.

Galaxy S4 stock browser css positioning

I am testing a page with a sticky footer. On the GS4 stock browser ONLY (not visible on android chrom), I get the sticky footer floating up and down the page as I scroll up and down. The footer also seems to have a stutter-looking effect. I've tested the same page on iphone 5 and gs3. This is my CSS flow:
.bar {
background-color: #F7F7F7;
overflow: hidden;
position: relative;
font-size: 13px;
}
.bar .footer-icon-holder {
padding: 5px;
display: inline-block;
width: 5em;
}
.bar .footer-holder {
width: 100%;
text-align: center;
margin: 0 auto;
height: 54px;
background-color: #FFF;
bottom:0;
-webkit-backface-visibility: hidden;
position: fixed;
}
and the footer html:
<div class="footer" ng-controller='footerController'>
<div id = "footer" class="bar">
<div style="margin:0 auto;">
<div class="footer-holder">
<div class="footer-icon-holder" ng-click="clickPic('home')" >
<div ng-show="homeSelected">
<img ng-src={{imageOnHome}} class="footerimg">
<div class="toolbar-img-text">home</div>
</div>
<div ng-hide="homeSelected">
<img ng-src={{imageOffHome}} class="footerimg">
<div class="toolbar-img-text">home</div>
</div>
</div>
</div>
</div>
</div>

Phonegap application position fixed menu

I'm working on a mobile application and I have a fixed footer menu.
<div id='footer'>
<ul class='menu'>
<li>menu1</li>
<li>menu2</li>
</ul>
</div>
#footer { height:99px; background:url(../images/black2.png)repeat-x; border-top: 1px solid black; position:fixed;bottom:0;width:100%;}
.menu { max-width:640px; margin:auto; }
I tested it on an Android device. The problem is that when I change the device orientation the menu ul's margin:auto doesn't work until I click on another menu item.
Thank you!
I resolved this by changing CSS.
#footer { height:99px; background:url(../images/black2.png)repeat-x; border-top: 1px solid black; position:fixed;bottom:0;width:100%; text-align:center;}
.menu {width:100%; max-width:640px; display:inline-block; }
I would do something like this:
HTML
<div class="footer">
<ul>
<li>menu1</li>
<li>menu2</li>
</ul>
</div>
CSS
.footer { background: black; position: fixed; bottom: 0; width: 100%; text-align: center; }
.footer ul { color: white; width: 90%; margin: 0 auto; display: block; list-style: none; }
.footer ul li { padding: .25em; display: block; }
On top of that I'd tell you to checkout the "fixed-fixed" plugin from the Filament Group (that aids in mobile fixed positioning since all phones/ tablets don't support it):
https://github.com/filamentgroup/fixed-fixed
On top of top of that, I'd recommend their entire workflow for building for mobile:
https://github.com/filamentgroup/Southstreet/

Categories

Resources