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


Responsive web design code for mobile devices

Posted on 2014-01-25
Medium Priority
Last Modified: 2014-02-16
I have a webpage that I am creating and am trying to find the proper code for having it display properly on any device.  So that the page will be responsive based on what the screen size it is trying to display on.  Any direction would be greatly appreciated
Question by:FreddyBass
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
  • 2
LVL 54

Accepted Solution

Scott Fell,  EE MVE earned 1500 total points
ID: 39808925
I use bootstrap and foundation.  http://getbootstrap.com/ and  http://foundation.zurb.com/

Everything is set up for you and you just need to use classes like below that would create stacked rows for a phone and two equal columns for everything else.

<div class="row">
   <div class="col-xs-12 col-sm-6">stuff</div>
  <div class="col-xs-12 col-sm-6">stuff</div>


Open in new window

Some examples

Author Closing Comment

ID: 39862656
Thank you for your input Scott, it was not exactly what I was looking for but it gave me some info to get going in the right direction.  Thank you for taking the time to give me your suggestions.
LVL 54

Expert Comment

by:Scott Fell, EE MVE
ID: 39862824
What is it you are looking for?  The core of making a responsive site will be using media queries where you define a class for multiple screens.  You can spend a lot of time doing this from scratch.... or you can use bootstrap or foundation or even 960.gs.  These libraries are not meant to be your template, they just make it easier by not having to reinvent the wheel.

<!-- CSS media query within a style sheet -->
@media (max-width: 700px) {
  .left_side {
    width: 100%;
  .right_side {
    width: 100%;

@media (min-width: 701px) {
  .left_side {
    width: 30%;
  .right_side {
    width: 70%;
<div class="container"
<div class="left_side">I will be full width if the viewport is 700px or below and 30% width if the viewport is 701px or more</div>
</div class="right_side">I will be full width if the viewport is 700px or below and 70% width if the viewport is 701px or more</div>

Open in new window


Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

In this article you will learn how to create a free basic website on Bitbucket, a git service provider. Polymer creates dynamic HTML components, which allow more flexibility than static HTML. This tutorial uses Ubuntu Linux but can also be done on W…
This article discusses how to implement server side field validation and display customized error messages to the client.
The viewer will learn how to dynamically set the form action using jQuery.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
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