I'm working on a webpage for a client and I'm creating a mobile responsive version for them.
I've worked through most of the website, however, upon loading my 'Services' page, there is an eyesore of a gap all along the right side of the page. Strange, because it uses the same CSS as all the other pages, which all display at full 100% width.
Devices tested with:
iPhone 4 - Chrome, Safari
iPhone 5 - Chrome, Safari
I've also tested this with a Samsung S3, but in Chrome it seems to load fine.
In addition, I've tested it using the Safari developer tools and inspected the page.
It seems as if the HTML from the get go isn't conforming to the 100%.
I've got no idea how to fix this!
The page is http://temp3.advisible.com.au/services
Thanks in advance!
I've managed to solve this problem for anybody who has this issue in the future.
I used a Wordpress page selector and changed the html width of the page.
A messy solution, but it works.
<?php
if (is_page('services')) {
echo "<style>
#media only screen
and (min-width : 320px)
and (max-width : 480px)
{html {width: 340px; }}
</style>";
}
?>
Related
Getting close to finishing this WordPress website: www.the-hind.com, which displays fine on desktop browsers, but my only issue is that on iPhone ONLY the the sidebar on the right is pushed at the bottom of the page. I tried so many things in CSS but probably have been looking at it for so long that can't see the answer.
I'm sure (wishful thinking) that the solution is something simple & obvious, for an expert like YOU.
Looking forward to any help you can offer.
Your theme is Fully responsive by definition ( http://wordpress.org/themes/blaskan ) and this is how it is supposed to work ( it will not happen only in iPhone, but eventually in any device.
If you want to change it you should change the css file :
http://the-hind.com/wp-content/themes/blaskan/framework.css?ver=3.5.1
with the relative parts of the media queries :
/** =STRUCTURE MIN: 480px ----- */
#media only screen and (min-width: 480px)
and :
/** =STRUCTURE MIN: 768px ----- */
#media only screen and (min-width: 768px)
to understand more read here and also here or search "media queries" on google ..
The "iPhone only" will be due to screen-size. There will be other devices it happens on. So the key is to edit CSS and add the various sizes. While making your changes, test on all device sizes.
Try using this online and free tool which allows input of any sizes then the testing of multiple screens at once...
Responsive Design bookmarklet by Benjamin Keen
If you want a really nice and clear tutorial try this...
Responsive Web Design by Shay Howe
When I add the jquery-mobile javascript to my site some of the background css images fail to load until I go to a different page and come back to the home page.
<script src="http://code.jquery.com/mobile/1.1.1/jquery.mobile-1.1.1.min.js"></script>
The second I delete the import line, the images load fine. What might be the issue?
This issue only appears on the ios safari browser and a UIWebView. Works fine in a PC browser.
Seems like it was a jquery-mobile bug. Switching to the latest beta version did the trick for me:
<script src="http://code.jquery.com/mobile/1.2.0-beta.1/jquery.mobile-1.2.0-beta.1.min.js"></script>
As the title says. Here is the URL if you have an iPad - How can I remove the responsive width of the Comments Plugin for iPads? (bottom of page) http://dev.assessmentday.co.uk/aptitudetests_numerical.htm
I ran into this too. I've worked around it by manually adding the data-mobile attribute set to false if I detect this is on an iPad:
<script>
if (navigator.userAgent.match(/\biPad\b/)) {
document.querySelector('div.fb-comments')
.setAttribute('data-mobile', 'false');
}
</script>
This could be improved to handle other tablets as well, but the best way to do that depends on how Facebook auto-detects "mobile", which I'm not sure of. Perhaps based on display width, perhaps based on the presence of touch event handlers, or perhaps indeed by user-agent on the server-side.
I have an image gallery, the images are large enough to fill an iPhone screen.
The images are also links, so as you can imagine, scrolling becomes quite frustrating on the iPhone because you're constantly clicking links by accident.
Is there anyway to prevent this using css alone?
If not then what would be the most simple solution to this problem?
Thanks!
I would suggest to use the Javascript. However, I found a way using only CSS. First step, you will need to identify the client browser, just add the code below in your HEAD session in HTML file:
<link rel="stylesheet" media="only screen and (max-device-width: 480px)" href="../iphone.css" type="text/css" />
Only if client is using a browser in iphone, the content of "iphone.css" will be loaded.
In this file "iphone.css", you need create a class to disable the links:
.disableLink {
pointer-events: none;
cursor: default;
}
In your HTML code of gallery, add the references in your links:
IMAGE
These steps works only in iPhone/iPod touch, but if you look in my second reference, you will see the way to adapt for iPhone 4/iPod touch 4G:
I don’t think there’s a CSS-based solution (CSS isn’t really designed to change the behaviour of HTML elements).
You could use JavaScript on page load to check the width of the browser’s viewport, and then find and disable/remove the links if the viewport is phone-sized.
See PPK’s ‘A Tale of Two Viewports’ article to figure out which JavaScript properties to check to figure out the width in your situation (I haven’t done enough mobile development to remember off the top of my head).
I like the idea of pointer-events: none;, but I wouldn't use it because it isn't well-supported.
If we're defining a mobile device as just having a certain screen size, I would do something like this:
$(function () {
var mobile = ($(window).width() < 481);
$('#image-gallery').find('a').click(function (e) {
if (mobile)
e.preventDefault();
});
});
However, I would try to define 'mobile' as something else, e.g., a browser that supports touch events.
OK, I'm having some issues with my site's mobile stylesheet on the iphone. I reworked the stylesheet to be similar to what http://m.facebook.com give the browser, only I'm getting an issue where the Safari on iPhone browser is still zooming the page out from like 960px, instead of constraining it to the native screen resolution. What gives?
Do you think it has to do with my .container960 class on the body element? I tried reseting those styles with the mobile stylesheet, but maybe it's not reseting the container styles properly.
The site is http://beta.cureinternational.org. You'll need to use username Guest and password guest to view the page.
Have you tried adding a meta-tag like this?
<meta name = "viewport" content = "width = device-width">
Or hard-coding in the dimensions yourself (see Viewport in https://developer.apple.com/library/content/documentation/AppleApplications/Reference/SafariHTMLRef/Articles/MetaTags.html)