August 20, 201412 yr Hello I have been working on a site for a client, and I have near enuogh finished the website, when i went to test it on mobile its stuck to the left and the size of it is ha little bit over the place, i gogoled what to do and tried something with a <meta name="viewport" content="width=480"> but it didnt work and i am at a loss of what to do to mak it fit the whole screen on all mobile, tablet devices. The website is http://www.maggiesgrill.co.uk/menus.html I am dyslexic so sorry for spelling, if anyoen does decde to help can please be clear as i struggle to read text in front of me. thank you for the help Edited August 20, 201412 yr by Connovar
August 21, 201412 yr To work properly on mobile you need your website to be responsive which isn't. the width of your contentbox is a static 960px. An iPhones viewport width for instance is somewhere around the 420px mark. In a repsonsive design all the widths for your layouts should be in percentages and you should also be using media querys to style things based on the viewport width. The meta tag you want for mobile and tablets is this: it stops iphone from automatically scaling your site -- but like above it wont don't much with a non-responsive site. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"> Edited August 21, 201412 yr by rbrtsmith
August 21, 201412 yr Author So going forward i need to start working in percentages? is that just for container divs or do you mean everything should be in percentages? This is my first website, and the owners know i am new at it, and are happy with what they have, I have raelised i need to do a lot of stuff diferently going forward, I am studying this at college but unfortuantely my lecturer does not know how to code which makes things very difficult to learn as I have learning difficulties so i prefer one on one teaching methods >.< Do you have any sources that would be useful to me going forward? Thank you for your time
August 21, 201412 yr Author i have done what you said and it does work butter, but the banner has been cropped can this be fixeD?
August 22, 201412 yr I've got a piece of golden advice for you: Sign upto CodeSchool, it's something like $30 per month but it will teach you 999999% more than your college ever could. Responsive design is not simply everything in percentages it depends entirely up on the design, sometimes I have a fluid column on the left and then on the right a column of fixed width, but together they always occupy 100% of their container. Here is a site I recently developed, drag the window to resize it and you will see the contents always adjust to the screen size, responsive design isn't something that can be learnt in a few hours it takes time to understand all the underlying fundamentals of CSS. You will need to understand that box model, floats, positioning (relative vs absolute) what a clearfix is and so on. All those can be learnt from the resource I mentioned to you above. Here's my example: http://wasabiadmin.se/cajsas-kok/ Edited August 22, 201412 yr by rbrtsmith
August 22, 201412 yr In regards to your current link I see no changes, but with a wide banner such as yours it will obviously be cropped unless you make it responsive so that it's aspect ratio remains the same -- however on a mobile that particular banner will have almost no height so actually the banner being cropped is a good thing -- look at the banner on my example, the image remains responsive to a point then the sides begin to crop away maintaining the height that is required to accomodate the content.
Create an account or sign in to comment