English 中文(简体)
What is a CSS framework?
原标题:

Can anyone tell me about CSS frameworks, and how to use them?

最佳回答

CSS frameworks are just CSS files. They provide pre-written CSS that you apply to your HTML by using the class names defined by the framework in its CSS file.

  • Some frameworks are focused on one particular task, e.g. page layout. 960.gs is a good example of this.
  • Some frameworks are more extensive, and include pre-written CSS for typography, form layout, print styles etc. Blueprint is a good example of this.

Some frameworks also include reset styles, which attempt to reset all styles for all HTML elements to very neutral defaults. These are automatically applied to all HTML elements, so you don’t add classes to your HTML to apply them. A lot of them are based on Eric Meyer’s CSS reset.

问题回答

From Wikipedia:

A CSS framework is a pre-prepared library that is meant to allow for easier, more standards-compliant styling of web pages using the Cascading Style Sheets language. Like programming and scripting language libraries, CSS frameworks are usually incorporated as external .css sheets referenced in the HTML . They provide a number of ready-made options for designing and laying out the web page. While many of these frameworks have been published, some authors use them mostly for rapid prototyping, or for learning from, and prefer to handcraft CSS that is appropriate to each published site without the design, maintenance and download overhead of having many unused features in the site s styling.[29]

There is a lot of material on SO (which framework to use, whether to use one at all....)

CSS frameworks address some or all of the following aspects:

  1. Browser reset. This brings all browsers back to the same baseline styles so that you don t get surprised by something rendering differently in different browsers.

  2. Layouts. They can provide pre-prepared styles that allow you to achieve certain layouts in a simple way. These include columns and also grid layout techniques.

  3. Design. Some provide colour schemes, font selections, typography (line spacings etc.) to quickly give your page an appealing design.

Important to realize that you can mix and match - as long as you re careful.

For instance I don t particularly like YUI s Grid framework (not flexible enough for what I need) - and I don t particularly like Blueprint s typography (because I don t understand what it s doing and I think it s trying to do too much).

So I m using YUI CSS Reset with YUI Typography and Blueprint grids !

CSS framework is a "wrapper" for all the styles and layouts on your Mark-Up (HTML etc) pages.

An example would be: http://www.blueprintcss.org/

Predefined functionality that has been created intended to serve as a guide for building of something useful. There different frameworks with different functionality often a (programming tools)layered structure indicating what kind of functionality can be built and how they would work.

CSS frameworks are pre-prepared libraries that are meant to allow for easier, more standards-compliant styling of web pages using the Cascading Style Sheets language.

For more info on how to use each framework, please consult the official documentation of that framework.

Examples of popular CSS frameworks :





相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

jquery ui dialog opens only once

I have a button that opens a dialog when clicked. The dialog displays a div that was hidden After I close the dialog by clicking the X icon, the dialog can t be opened again.

Drop down background url in Safari Issue

selectBox.selectCSS { background: url(/Images/replacementSelectBackground.png) top left no-repeat height:auto; } I have an issue in Safari only where the image is not rendering on top ...

CSS specific for Safari

How do you target specifically safari in css with styles?

Aligning textarea in a form

Ive used the following css code to align my form elements: form { position:relative; } form input { position:absolute; left:11em; } However, the textarea element is not aligned correctly with the ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

CSS problem with page footer

I have defined my page footer in the css file as: #footer { position: absolute; height: 50px; text-align: center; background: #66CCCC; bottom: 0px; left: 0px; width: 100%; height: ...

热门标签