Learning Web Design: Adding Structure with CSS using Resets, Grid Frameworks, & LESS CSS

عقد بيع اسهم بالتقسيط You may have learned how to write rudimentary HTML, or even have come from a background of creating websites using tables, or neither. In any case, you're at the point where you need to bring your site to life by giving it some structure. I will introduce several components of HTML & CSS you'll need to know, and a few tricks as well. This is the first post of a two part series discussing how to add structure to your site with CSS. The second post can be found here.

الخيارات الثنائية السعودية

انقر Before getting too excited about hand-coding up a storm, I want to point out a few best practices for lessening your workload. There are two things I would recommend doing. These are to 1) use a CSS reset, and 2) use a CSS framework. As I will soon elaborate on, a reset file removes default browser CSS styles, readying your canvas for pixel-perfect design. Additionally, a CSS framework will have already addressed a number of common needs in many websites. I will contrast and compare several of the available frameworks.

Resets

http://www.cudesign.net/?narkobaron=%D9%81%D9%88%D8%B1%D9%83%D8%B3-%D8%A7%D9%84%D9%85%D8%AF%D9%8A%D9%86%D8%A9&e93=32 If you are not already aware, each browser actually applies a whole bunch of default CSS to your HTML, even if you didn't write any CSS. This is why elements like h1, h2, h3, h4, etc. have different sizes. These are the default browser styles, and they are troublesome because they are different across browsers.

هو قال Imagine trying to create a pixel perfect design, but you can't rely on having consistent margins, padding, etc. This is the problem a CSS reset solves. A CSS reset is simply a CSS file which includes a collection of rules designed to remove all the default browser styles. Many reset files also provide additional helpful features like a .clearfix rule (which I will explain later).

http://marshguard.com/?kafka=%D8%A3%D9%81%D8%B6%D9%84-%D8%A7%D8%B3%D8%AA%D8%B1%D8%A7%D8%AA%D9%8A%D8%AC%D9%8A%D8%A9-%D8%A7%D9%84%D8%AE%D9%8A%D8%A7%D8%B1%D8%A7%D8%AA-%D8%A7%D9%84%D8%AB%D9%86%D8%A7%D8%A6%D9%8A%D8%A9-%D9%85%D9%86-%D8%A3%D9%8A-%D9%88%D9%82%D8%AA-%D9%85%D8%B6%D9%89&9c2=8a I recommend using the Normalize.css file. It is the reset file included in the HTML5 Boilerplate which has become somewhat of a standard starting point for many developers.

فوركس Normalize.css
HTML5 Boilerplate

ثنائية النخبة مؤشر الخيار تاجر All you need to do is click the 'Download' button on the home page, and copy/paste the text into a new file on your server. Make sure you include the file before any other styles to prevent specificity conflicts.

Grid Frameworks

تداول اسهم بوان Frameworks are much more advanced than a simple reset file. Due to the overwhelming number of CSS frameworks available, it is likely you can find one that suits you. A couple of years ago, I drafted an article comparing the top 3 CSS frameworks since there were only a few notable ones at the time. Since then, the number of frameworks has exploded and especially so since the advent of the tablet era. Many frameworks now include support for responsive design and mobile friendly layouts (which I think is necessary). Also, note that when I say "framework" I mean "grid framework" meaning, one which assists with implementing grid-based designs.

أدخل I recently went through a round of reviewing available CSS frameworks to use on a new project and landed on one I hadn't used before: The Semantic Grid System. This framework supported nearly all of our needs: fixed layouts, fluid layouts, max-width, nested columns, responsive design (there are examples for each of those on the site's home page). Also, it runs with SCSS (see below), which we had also chosen to use.

انتقل إلى موقعي Other available grid frameworks:

http://www.cottages-with-a-view.co.uk/?klipsu=%D9%81%D8%AA%D8%AD-%D8%AD%D8%B3%D8%A7%D8%A8-%D9%81%D9%88%D8%B1%D9%83%D8%B3-%D9%85%D8%AC%D8%A7%D9%86%D9%8A The Semantic Grid System
960.gs
adapt.960.gs
Blueprint
Golden Grid System

LESS CSS

لماذا لا تحقق هنا LESS CSS is JavaScript utility that allows you to write more concise CSS. A simple example will suffice as a convincing reason to use it.

http://greentrax.com/?arbyz=%D8%AA%D8%AF%D8%A7%D9%88%D9%84-%D9%86%D8%B3%D8%AE%D8%A9-%D8%AE%D9%8A%D8%A7%D8%B1-%D8%AB%D9%86%D8%A7%D8%A6%D9%8A&d73=2a #container { color: red; } #container.left .content { text-align: left; } #container.right .content { text-align: right; } #container .content span { padding: 10px; } #container .content span a { text-decoration: none }

تداول الخيارات الثنائية الشرعي Original CSS

http://iceandfire.co.uk/?labyda=%D8%AA%D8%AF%D8%A7%D9%88%D9%84-%D8%A7%D9%84%D8%AE%D9%8A%D8%A7%D8%B1%D8%A7%D8%AA-%D8%A7%D9%84%D8%AB%D9%86%D8%A7%D8%A6%D9%8A%D8%A9-%D8%AD%D9%84%D8%A7%D9%84-%D8%A7%D9%85-%D8%AD%D8%B1%D8%A7%D9%85&a8c=06 #container { color: red; &.left { text-align: left; } &.right { text-align: right; } .content span { padding: 10px; a { text-decoration: none; } } }

وأوصت تقرأ LESS CSS

الخيارات الثنائية حساب تجريبي أستراليا In my opinion, the biggest benefit from a CSS extension script like LESS is the ability to nest rules. As stated on the website, there are also a few other super powerful features such as variables, mixins, operations, and functions. All of which ultimately allow you to actually write less code.

I almost never start a project without choosing either SASS or LESS. There's a good article comparing the two here: An Introduction To LESS, And Comparison To Sass.

Now on to Part 2...

I originally intended to cover positioning, floating, and clearing in this post but it turned out to be a bit too long for my taste.

So, I've simply moved the next section into a post of its own:
Learning Web Design: Adding Structure with CSS using Positioning, Floating, & Clearing.

Related Books

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>