Solved

How to set up proper CSS 3 for a website

Posted on 2014-01-27
5
415 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 51

Accepted Solution

by:
Julian Hansen earned 167 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

744 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

13 Experts available now in Live!

Get 1:1 Help Now