Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Website Setup and CSS

Posted on 2013-01-04
8
Medium Priority
?
337 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

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.
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
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 a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
Suggested Courses

636 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