Solved

How to set up proper CSS 3 for a website

Posted on 2014-01-27
5
418 Views
Last Modified: 2014-02-20
I am looking to set up a proper design spec for a website, but I do not want mobile browsers to have a problem viewing the web site.  I know that if the page is too wide, problems may surface for viewers to view a page and so and so forth.  How could I set up the website so that it is viewable in any browser in any sized screen?  Is there a CSS/HTML template to start from?  Is there a framework that most people use?  Just like most popular websites, I want the top banner to be 100% wide in the screen but as far as the rest of the site content, I would like it to take up some space but not 100% width.  Can anybody help me on this so that I could get started on this right away?  Thanks!
0
Comment
Question by:VBBRett
5 Comments
 
LVL 54

Accepted Solution

by:
Julian Hansen earned 167 total points
ID: 39814164
There are several you can look at

Bootstrap and boilerplate are both widely used mobile first / friendly templates.

Bootstrap (http://getbootstrap.com/)

Boilerplate (http://html5boilerplate.com/)
0
 
LVL 52

Assisted Solution

by:Scott Fell, EE MVE
Scott Fell,  EE MVE earned 167 total points
ID: 39814217
At the heart of what you are asking about is using media queries. https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Media_queries
.myStyle{width:50%}
@media (max-width: 700px) {
.myStyle{width:100%}
}

Open in new window

The code above would make an item's width 50% on a large screen and 100% on the small screen.  

Setting up for multiple viewports on one page will take some work.  I prefer to use libraries like bootstrap http://getbootstrap.com/ and foundation http://foundation.zurb.com/

Both have the basic css/grid ready to go along with javascript/jquery helpers.  The responsive grid is the heart. Instead of writing media queries, they are done for you and all you need to do is apply a class
<div class="row">
  <div class="col-sm-12 col-md-3">Narrow Left Large screen/full width small screen</div>
  <div class="col-sm-12 col-md-9">Wide right Large screen/full width small screen</div>
</div>

Open in new window

Check out the examples and you can get a better idea.
http://getbootstrap.com/getting-started/#examples
http://foundation.zurb.com/learn/website-examples.html

Both foundation and bootstrap are similar, if you like to use template themes,  you will find more written against bootstrap.
0
 
LVL 18

Assisted Solution

by:bruno
bruno earned 166 total points
ID: 39819848
Bootstrap, boilerplate are all good starting points for your code, but you want might to start with some general knowledge of responsive web design, which is the concept of using fluid grids, flexible images, and media queries.
0
 
LVL 58

Expert Comment

by:Gary
ID: 39875307
I've requested that this question be closed as follows:

Accepted answer: 168 points for padas's comment #a39814217
Assisted answer: 166 points for brunobear's comment #a39819848
Assisted answer: 166 points for julianH's comment #a39814164

for the following reason:

This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Changing way home page shows 2 29
ebay api to see some data about my customers 2 25
Eloquent ORM manual paginator defaults to simple 2 19
div to fit another div 8 20
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
Find out what you should include to make the best professional email signature for your organization.
This video teaches users how to migrate an existing Wordpress website to a new domain.
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.

816 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now