Web site from PC to mobile and content size problems - css

I have a web application for PC screen browsers (#media screen{}) and I want to make it friendly for smartphone screens.
Unfortunately my 12pt fonts and my 128x128 pictures appear very small in my smartphone with a 1280x800 resolution (Samsung-Google Nexus).
Before make additions to CSS for a smartphone like mine, what I must have in mind to create a web application for a variety of smartphone screen resolutions?

Can you try to add this in css :
<meta name="viewport" content="width=device-width, user-scalable=false;">
from : https://developer.mozilla.org/fr/docs/Mozilla/Mobile/Viewport_meta_tag
History about viewport, i'm not sure....

There are many approaches to create a responsive website- Responsive, Designed for mobile, and Mobile first. However, nowadays, we consider more about Mobile First!. So, there are many websites teaching you how to create a responsive websites and mobile first approach for example:
Firstwebdesigner
WebdesignTuts
The first thing to think of when building a responsive site is simplicity. Web designers love to show off that they can design the hell out of a website. They fall in love with their code and all the cool things that it can do.
10 Basic tips about responsive design
Keep your layout simple
Use media queries
Define the break points
Make your layout flexible
Make your picture behave
Don't foget make and min
Make most things relative
When mobile linearize
Skip the none essential content
Check your meta viewport
You can see more information on Dan Rowinski's article. This is a great article to answer your question, what you must think before creating a responsive web application.

Related

Responsive design for mobile only, not desktop

I'm trying to make a site that will be responsive on mobile devices but not on desktop computers.
I created a media query with the following breaking points: 320px, 321-480px, 481-680px, 681-778px, 779-1280px. The problem is that these apply to resized browsers on desktop computers too and display the mobile version. I want it to ignore these breaking points and display the desktop version of my site regardless of window size.
Is this possible? Thank you very much for an answer!
It doesn't make a lot of since to make a responsive site that is only responsive for mobile. Maybe use a server side script for device detection and make two separate sites for mobile and desktop.

Responsive Mobile Website Design

I have created a responsive website which has a mobile.css with multiple sizes to suit most common devices. What is the best practice from your experience to ensure that each size I have specified in my mobile.css will format the page correctly on all devices.
What I am wanting to achieve is a stretching of elements to fit the page when within the specified min/max limits specified in mobile.css. Are percentages the best practice to achieve this?
Let me know if you need any more information.
The best thing to do is test it on each device. You don't need to have every device that there is, you only need a device with a fixed screen size. Also try to get devices with different browsers, opera, chrome, IEmobile etc. Thats the safest.
There are websites out there that can emulate device sizes and display your website in those scales, But they do not emulate the mobile browsers. See if you can get a couple devices.(Ask friends and family or co workers.) And test it on each size you can.
Best of luck
#Media Queries are best practice in my experience refer to this documentation and there are some really nice examples
When testing FireFox has a default User Agent Plugin that can act as different Browsers, You can also get the Web developer Extension which has a resize menu to show you the responsive versions of your sites. Google Chrome has similar plugins.

How to figure out proper min-width and max-width values for responsive CSS?

I'm just now diving into responsive CSS and design, and I'm wondering how I'm supposed to figure out various device widths out. I don't want to spend all day testing every single mobile device possible, I just want to get the responsive layout enough to where it works.
I saw some sites using #media only screen and (max-device-width: xx) but it seems that limits it to very specific resolutions, not actual browser window sizes.
Any advice at all would be great. I'm not new to web development or CSS, but totally new to responsive design.
It would seem that you're trying to figure out where and when to apply your breakpoints.
Rather than testing resolution on a bunch of devices why not build a responsive design that is acceptable at every resolution? There are no magic breakpoints that fix responsive websites for every device because every responsive website is going to differ depending on layout, content, etc. and there are tons of different devices with varying resolutions.
You might be thinking, "what the hell, I am not going to go pixel by pixel and check my website," but that's not really what I mean.
Finding your website's breakpoints:
Jump into a browser, navigate to your website, and open the console
Resize the viewport to a very low resolution. 320px is a good starting point.
(Note: To get the size of the viewport type window.innerWidth in console. See Resources for more ways to enhance debugging your design)
Analyze your layout. How does it look at this resolution? If you need to change the layout at this resolution then its time to add a breakpoint!
Slowly stretch the browser window until something breaks or looks horrible. At this point you'll need to insert another breakpoint.
Repeat step 4 to your heart's content
Keep in mind:
The point of responsive design isn't to make your site look good on all devices, its to make your content look good anywhere - Sam Richards
Resources:
Responsive Web Design - Programming with Anthony
Responsive Typography
Logical Breakpoints For Your Responsive Design
As mentioned in the above video, Modernizr is an awesome JS library that helps in detecting device-specific features
Responsive Design View Feature in Firefox 15+
Responsive Design View Tutorial for Chrome

I want to emulate a mobile browser. How to implement it using Page.ClientTarget?

Based on the MSDN link
http://msdn.microsoft.com/en-us/library/system.web.ui.page.clienttarget.aspx
Assuming I want to see how my page will look like on safari or mobile firefox, how do I implement it using Page.ClientTarget?
I can't seem to find any good resources for this API.
Thank you.
You could just use responsive design, that way you are not relying on the ClientTarget, but rather on the size of the browser.
Responsive Design basically means your design adapts to the size of the screen ... so tablets and phones can have different views of the same page.
Bootstrap is a decent place to start, but there are other frameworks.

How do I fix my website so that it works on mobile devices?

I am trying to make my website resize on handheld divices but form some reason its not responding to the stylesheet.
If you take a look here: responsive design link and put www.sofiamillares.com as the site test, the top lines get cut off and everything looks super big.
Can some one please enlighten me on why is it doing that and what would be the easiest way to fix it?
This is happening because your design is not completely fluid.
Only your container div will adjust with the width (a bit)
To fix this quickly, you could
give your divs percentage widths, so they scale with the screen resolution
float your square boxes at the bottom, so they will stack on smaller screens
consider using media queries or some js device detection to target mobile devices and send them a modified css stylesheet.
Get some ideas here: http://mediaqueri.es/
As Jason suggests, creating a mobile specific version of your site is usually the best solution. You can then test the user-agent string for phrases like "android" and "iphone" and re-direct the user to your mobile site. There are libraries available for JavaScript as well as many server-side programming environments (PHP, ASPX, etc) which do all sorts of browser detection for you.
When building a mobile site, you'll of course want to make the page lightweight so it'll load quickly over a mobile data connection, and format it appropriately for a smaller screen in portrait orientation.

Resources