background preloader

Layout

Facebook Twitter

How To Create an IE-Only Stylesheet. #40: How z-index Works. #42: All About Floats Screencast. All About Floats. What is "Float"? Float is a CSS positioning property. To understand its purpose and origin, we can look to print design. In a print layout, images may be set into the page such that text wraps around them as needed. This is commonly and appropriately called "text wrap". Here is an example of that. In page layout programs, the boxes that hold the text can be told to honor the text wrap, or to ignore it. Ignoring the text wrap will allow the words to flow right over the image like it wasn't even there. In web design, page elements with the CSS float property applied to them are just like the images in the print layout where the text flows around them.

Setting the float on an element with CSS happens like this: There are four valid values for the float property. What are floats used for? Aside from the simple example of wrapping text around images, floats can be used to create entire web layouts. Floats are also helpful for layout in smaller instances. Clearing the Float The Great Collapse Video. Absolute Positioning Inside Relative Positioning. A page element with relative positioning gives you the control to absolutely position children elements inside of it. To some, this is obvious. To others, this may be one of those CSS "Ah-ha! " Moments. I remember it being a big deal for me when I first "got it". Here is a visual: The relative positioning on the parent is the big deal here.

Might not look like a big deal in this small example, but it really is a significant change. Once you "wrap" your head around this concept (rim-shot) you will find little uses for it all over the place, and start noticing examples of other places using it. How about some examples? I'd be delighted. View Demo Download Files Share On. 10 CSS-Lifesavers For Efficient Web Design. 10 CSS-Lifesavers For Efficient Web DesignCSS has been hailed and cursed by many web designers and developers around the world. On one hand, it makes our lives easier by separating content from style, which makes the entire process much more organized and easier to deal with.

On the other hand, CSS has it's fair share of quarks, misunderstandings, and overall issues that bare some explanation. Today, we will go over 10 CSS lifesavers and tips for a more efficient web design process. 1. Learn how to use z-index properly The z-index property can be extremely useful when utilized properly. Unfortunately, a lot of developers and designers alike do not seem to fully understand how z-index works. The secret to using z-index properly, is positioning.

Check out the where can I learn more section below for some great links and screencasts on z-index. How can it help? Quite simply, it can help by providing the functionality it was meant to, layer objects/elements in a specific order. 2. 3. 4. 5. 6. Mastering the 960 Grid System. We're already familiar with the 12- and 16-column variants of 960.gs, but did you know that a 24-column alternative exists too?

In this article, you'll master the 960 grid system by dissecting the 24-column version demo. If you've only used 960gs before for Photoshop mockups, consider this your lucky day. By the end of this article, you'll be able to convert your designs to HTML and CSS in no time at all. A 960 Grid System Master—that's what you'll be after you've gone through this article. We first need to check the HTML code of the demo, so view its source—if you're using Chrome, Firefox, or Opera, just press ctrl+U; if you're using Internet Explorer, change your browser!

Next, you'll need to download the 960.gs files (if you haven't done so yet), and open the uncompressed CSS file 960_24_col.css. That's pretty much all we need to prepare, aside from a semi-functioning brain. The three sections consist of the following: As you can see, Here's an example of how to use it: Good questions. Driving the 960 Grid System. CSS frameworks are unflexible, overbloated and confusing. Whoever said that, never used a CSS framework, or at least the 960 Grid System. I used to think that too, some time ago, but I did use the 960 Grid System to draw my templates.

I didn’t care about the CSS, the columns, etc. All I used were the Photoshop templates with a preset grid of 960 pixels, which was pretty convenient for designing purposes. Maybe I didn’t take enough time to read all the info about the 960 Grid System, maybe I was just afraid of CSS frameworks, or maybe I thought that CSS is so simple that there’s no need for any pre-written code except for the Reset CSS. I instantly came across an awesome post by Jeffrey Way on NetTuts, written back in January 2009, called A Detailed Look at the 960 CSS Framework. After viewing the video, I decided to try it out, of course on my own blog.

Update: Here’s an awesome video by SitePoint called CSS Frameworks: Make the Right Choice: ‘How to design a portfolio site’ screencast. A Detailed Look at the 960 CSS Framework. CSS frameworks are bloated. CSS frameworks are for people who don't know how to code. CSS is too simple to implement a framework. If you've ever read a tutorial on a CSS framework, I can guarantee that many comments mimic the previous statements. My guess is that the majority of these comments are stemmed from slight ignorance. Pros Rapidly speeds up development time. Cons It's named "960" for a reason. Usage Let's imagine that we want to work with the "12 column" structure to create the extremely simple layout seen below. Specifying an id here isn't required by any means. Grids Now we want to create a simple header and two column structure. I'm going to choose a header width of "940px" (+ 20px margins = 960), a sidebar width of "220px", and a main content width of "700px".

You must assign a class to each div. The only additional styling that I've added is background colors and a minimum width for each div to simulate an actual website full of text. You Also Might Like. Prototyping With The Grid 960 CSS Framework. Grid 960 is a CSS Framework that enables developers to rapidly prototype designs. They are excellent tools for creating mock ups. Why? Because they do all the heavy lifting allowing you to get faster results. That sounds nice, but how do we do that? There are a lot of articles on the internet blasting or supporting CSS frameworks, but none have any content to help inexperienced readers decide.

Grid 960 works by using classes through inheritance. 60px140px220px300px380px460px540px620px700px780px860px940px Each width corresponds to a class name formed like this: grid_X where X is a number from the above list. When creating a row in the grid, make sure all the child grid_X numbers add up to the number of columns you're using. Visualizing the design's grid is easy. After checking out the visual, you should understand how to create the mockup's grid. The skeleton is ready. Apply the class to correct grid_12 divs and set the ID. The middle columns don't require any effects. Excellent! Sweet. The 960 Grid System Made Easy. By Joshua Johnson The first time I discovered the 960 Grid System, I was immediately excited about the possibilities of implementing complex layouts so easily. However, since I was fairly new to web design at the time, when I downloaded the files, I quickly became overwhelmed at how complicated the whole thing seemed.

With all this code, how could this be the easy way to create a layout? This article is for web designers and front-end web developers who are interested in grid-based layout systems but are at a loss on how to decipher them. We’ll focus specifically on the 960 Grid System, but after reading this guide, you’ll find that most of the other grid systems out there are similar and will make much more sense after you understand a few basic principles. Grid-Based Design Before we get into the specifics of the 960 Grid System, let’s briefly discuss grid-based design in general.

Our brains like to simplify things to make them readily understandable. Why Do I Need a Grid System? Typogridphy.