?
Solved

Website Setup and CSS

Posted on 2013-01-04
8
Medium Priority
?
335 Views
Last Modified: 2013-01-22
What is the best way to setup a website to take into account the size of a users screen.  Large apple 30 inch screens and small screen.  Also mobile devises.

Should I use a different CSS for each?  Should I only use percentage values in the CSS?

A little brief guidance here will be greatly appreciated.
0
Comment
Question by:rgranlund
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 31

Accepted Solution

by:
Marco Gasi earned 2000 total points
ID: 38744740
Very generally, the use of percentages are recommended in order to fit several screen sizes.

Developers don't agree if it's better to have only one site for all devices or several sites each for one device. Foundamentally, to have only one site makes mutch easier to mantain the site but probably it will oblige you to give up something in design and layout. To have one site for each device allows to always do the best for that device (and its user) but can make tha maintenance a hell.

You can learn more about responsive design here: http://www.9lessons.info/2012/12/responsive-web-design-css3.html?utm_source=feedburner&utm_medium=email&utm_campaign=Feed%3A+9lesson+%289lessons%29

Surfing the web, you can find many framworks to design flexible layouts using grids: https://www.google.it/search?q=css+grid&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:it:official&client=firefox-a

Cheers
0
 
LVL 7

Author Comment

by:rgranlund
ID: 38744754
@margusG

For example, here is a wordpress theme: http://themes.themedizain.com/dizain-01/
If you decrease the size of your screen you will see the site respond but it will not respond if you make the screen bigger than normal.

What is the way to do this, pure CSS?  How would I get the images to be larger?
0
 
LVL 16

Expert Comment

by:HagayMandel
ID: 38744772
It's called responsive layout or responsive web design, and you can find a lot of material including tutorial, examples & templates on the web.
A good starting point is Ethan Marcotte's article in A list apart.
Some frameworks like twitter bootstrap, already contain sets of css rules to meet different requirements by different devices.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 31

Expert Comment

by:Marco Gasi
ID: 38744792
You have to set the viewport to 100%. This will make your site occupie all the available space. Once you have set the body width to 100%, you'll can design your layout using percentages. Simply search through Google for responsive web design and/or responsive css
and you'll find tons of infos to realize your site.

Cheers
0
 
LVL 7

Author Comment

by:rgranlund
ID: 38744803
@Hagay and @ Marqus

What I'm really interested is how to make a background image stretch and shrink without causing it to pixelate?
@media 1140px         
@media 768px         
@media 480px         
@media 300px
If you change to any of these the image should get bigger or small.  How do you do that?
0
 
LVL 16

Expert Comment

by:HagayMandel
ID: 38744824
The best way is to use different images.
0
 
LVL 31

Expert Comment

by:Marco Gasi
ID: 38744858
I agree with HagayMandel. This is also the tecnique used by css responsive images.
Anyway you can find interesting this: http://viewportindustries.com/blog/automatic-responsive-images-in-wordpress/
0
 
LVL 111

Expert Comment

by:Ray Paseur
ID: 38746623
... make a background image stretch and shrink without causing it to pixelate?
The browser can shrink it for you.  But you don't want the browser to enlarge it for you - the results will be visually ugly.  Agree with HagayMandel - create different images for different sizes.  You will get the best look and you'll save bandwidth and storage when you're working with smaller viewports.

PHP can interact with JavaScript to detect the size of the viewport.  That may help you create a custom CSS document that loads the appropriate background images.
0

Featured Post

DFW AZURE MEETUP TONIGHT FRI 6PM

We will be discussing what Azure Stack is, how does it fit into the suit of offerings that Azure has currently, and where can it fit into your organizations technology stack. We will also be discussing limitations of the platform while covering various applicable scenarios.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
In this tutorial viewers will learn how to style different bullet points for unordered lists in CSS. Begin with a normal unordered list; the default bullet point is a solid circle: In the CSS, create a defined class of unordered list by typing "ul.S…
Suggested Courses

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question