Solved

How to set up proper CSS 3 for a website

Posted on 2014-01-27
5
421 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 55

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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
hbo knew my windows software 4 62
How to get bootstrap element to collapse at wider screen width 3 41
Media Queries  not Firing 6 17
How to create a table with buttons 3 21
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
Color can increase conversions, create feelings of warmth or even incite people to get behind a cause. If you want your website to really impact site visitors, then it is vital to consider the impact color has on them.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

840 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