Cascading Style Sheets: CSS Positioning and Layout

| Sunday
If you can't see this email, click here

About.com


CSS Positioning and Layout
Jennifer Kyrnin
From Jennifer Kyrnin, your Guide to Web Design / HTML
CSS gives you very precise control over the position of elements on your Web pages. You can control the size of the elements and where they are in the flow of the document, or give them specific coordinates and placement within the page layout.
Define Element Dimensions
Before you can place an element in your Web page design or create a layout, you need to define the dimensions of the element. By default, a Web page has a width of 100%, and the elements within that page will start out at that size as well, unless a more specific dimension is applied to them. In other words, if you have a paragraph on your page, it will take up 100% of the browser width, even if there is only 1 word in it. The box that makes up the paragraph will be 100% wide. See the CSS box model documention for more information.

Possible dimensions include:



Display and Visibility
Once you know the dimensions of your elements, you can define how they display on the page. The CSS display property defines what type of element it is. You can turn paragraphs into lists and block-level elements into inline elements.

The visibility property is a bit more specialized. It defines only whether an element can be seen in the layout or not. Note that an element that is hidden with the visibility property will still take up space, the contents just don't show on the page.


Methods of Positioning Elements
To position elements, first determine how you're going to position your elements using the CSS position property or floating elements with the float property.
  • normal flow positions elements as they appear in the HTML.
  • absolute position places the element in a precise location on the page, with 0,0 the upper left corner of the browser window
  • relative position places the elements in normal flow, with positioning starting from that position
  • floating takes elements out of normal flow and pushes them to the right or left sides of the document

Absolute and Relative Positioning
Use the position element:
position: absolute;

Absolute positioned elements are given positions relative to the upper left corner of the browser window. So if you position an element left: 10px and down: 10px, it will always display there, no matter what else is in the document.

Relative positioned elements are first placed in the flow of the document, then the positions are applied. So if you put a relative positioned item left: 10px and down: 10px, it will display slightly lower and to the left of where it would normally display.


Floating Elements
When you float an element, it takes it out of the normal flow, and pushes it to the right or left of the parent element. Once an element is floated, other elements in the normal flow will flow around the floated element like a river flowing around a rock.
float: left;

If you want to turn off the float, you can use the clear property to clear either the specific float direction or both floats at once.

clear: left;

How to Use Float For Layout
The trick to floating layouts is to draw your layout and then float everything. Define the widths on all your elements, even if it's relative widths (percentages) so that you have a good idea where things will end up. For example, if you have a container element that is 800px wide, if you float a 200px (0 margin, padding, and border) element to the left, you will have 600px worth of space to play with. If you then float a 550px width (0 margin, padding, and border) element to the right, the two elements will display side-by-side with a 50px gutter between them.

Stacking Elements with Z-index Layers
When you position elements, they can end up overlapping other elements. Using the z-index property you can define which elements are on top or below. Every element starts with a z-index of 0. The higher the z-index (up to 100) the more likely it will be on top. The lower the z-index (down to -100) the more likely it will be on the bottom.
z-index: 90;
z-index

Sample CSS Layouts
CSS is capable of handling most layout possibilities, here are some of the more popular layouts:


This email is written by:
Jennifer Kyrnin
Web Design / HTML Guide
Email Me | My Blog | My Forum
 
Missing a lesson? Click here.

About U. is our collection of free online courses designed to help you learn a new skill, solve a problem, get something done, or just learn more about your world. Sign up now, and we will email you lessons on a daily or weekly basis.
You are receiving this email because you subscribed to the About.com 'Cascading Style Sheets' email. If you wish to unsubscribe, please click here.

About respects your privacy: Our Privacy Policy

Contact Information:
249 West 17th Street
New York, NY, 10011

© 2010 About.com
 

Advertisement

Cascading Style Sheets Tip of the Day: Child Selectors

|
If you can't see this email, click here

About.com


Child Selectors
From Jennifer Kyrnin, your Guide to Web Design / HTML
Child Selectors
CSS 2 allows you to define properties that are parents or children of other selectors.



This email is written by:
Jennifer Kyrnin
Web Design / HTML Guide
Email Me | My Blog | My Forum
 
Missing a lesson? Click here.

About U. is our collection of free online courses designed to help you learn a new skill, solve a problem, get something done, or just learn more about your world. Sign up now, and we will email you lessons on a daily or weekly basis.
You are receiving this email because you subscribed to the About.com 'Cascading Style Sheets Tip of the Day' email. If you wish to unsubscribe, please click here.

About respects your privacy: Our Privacy Policy

Contact Information:
249 West 17th Street
New York, NY, 10011

© 2010 About.com
 

Advertisement

Build a Small Business Website: Publish and Test Your Website

|
If you can't see this email, click here

About.com


Publish and Test Your Website
Jennifer Kyrnin
From Jennifer Kyrnin, your Guide to Web Design / HTML

Once you're done building your website on your local hard drive, you need to get it from there to your Web hosting provider. This is called publishing, and you generally use an FTP (file transfer protocol) client to do it.

But once your website is up, your work isn't done. You need to test it. Hopefully, you've been checking your work all along in a Web browser on your hard drive, but once it's up on your Web host, you may find different problems. Testing is a critical piece of Web development. Don't omit it from your site, even if you're not the one building it. You should be the one testing it.

Publish Your Website
Best FTP Clients for Windows
My personal favorite Windows FTP clients. You'll need one to upload your website. Most are low-cost, many are free.


Best FTP Clients for Macintosh
My personal favorite Macintosh FTP clients. You'll need one to upload your website. Most are low-cost, many are free.

Reviews: FTP Clients
Reviews of specific FTP clients.


How to Upload Your Website
These are the steps you take to upload your Web pages to your Web hosting provider.

How to Set up Dreamweaver to Transfer Files
You can even use some Web editors to transfer your files to your Web host. This tutorial explains how to use Dreamweaver for FTP.

Testing Your Web Pages
How to Preview Your Web Pages
Previewing your Web pages is the first step to testing. Learn how to look at your Web pages before they are live, so that you can fix problems before anyone sees them.

Solving Problems in Web Design
By following the steps in this article you'll be able to narrow down what is causing a specific problem and thus fix it.

Graded Browser Support
Your website won't look perfect on every browser out there - that's just impossible. Here's a suggestion for how to choose the browsers to support and why.

How to Use BrowserCam to Review Your Web Site
Once your site is on the Web host, you can use BrowserCam to view your site in many different browsers on many different operating systems.

Next: Promote your website



This email is written by:
Jennifer Kyrnin
Web Design / HTML Guide
Email Me | My Blog | My Forum
 
Missing a lesson? Click here.

About U. is our collection of free online courses designed to help you learn a new skill, solve a problem, get something done, or just learn more about your world. Sign up now, and we will email you lessons on a daily or weekly basis.
You are receiving this email because you subscribed to the About.com 'Build a Small Business Website' email. If you wish to unsubscribe, please click here.

About respects your privacy: Our Privacy Policy

Contact Information:
249 West 17th Street
New York, NY, 10011

© 2010 About.com
 

Advertisement

Become a Freelance Web Designer: Promoting Your Business

|
If you can't see this email, click here

About.com


Promoting Your Business
Jennifer Kyrnin
From Jennifer Kyrnin, your Guide to Web Design / HTML

Your Web design business needs to be promoted to be successful, and promotion takes work. Beyond just your website as we talked about a couple days ago, you need to get the word out about your business. You should do this with both passive and active marketing.

I consider passive marketing to be anything where people learn about you and your business without you doing much. This means setting up a portfolio and getting your existing clients to talk about you to their friends. Active marketing takes more work, but can often help in getting more business or breaking into a new market.

Create a Portfolio
How to Create a Portfolio
Creating an online portfolio of your best work is a very important way to show what you are capable of. Portfolios provide details of your skills in design and development and are often critical to finding work. But a Web portfolio is more than just a list of screen shots and these tips will help you create a Web portfolio that will work for you.


What to Include in Your Web Design Portfolio
Your Web design portfolio should include examples of your best work. But Web design portfolios present special problems because you don't have hard copies to save for a print portfolio, and online screen shots don't capture the dynamic nature of the pages. Learn what to choose and how to display it.

What to Put in a Beginner's Web Design Portfolio
When you start trying to find work as a Web designer, you'll be asked to show off your portfolio of designs. But what if you've never worked as a Web designer? How can you get a job in Web design if you have to have a job to get a job? But you don't need to have had a job to put together a portfolio. Instead you need to show off what you can do with creative projects you've done for yourself.

Promoting Your Website
8 Tips to Take Your Website to the Next Level
Whether you're looking to get more fame or just more money from your website or blog, it can be challenging to move onwards and upwards. But sometimes it just takes one simple thing to get you started moving again. These ideas can help you improve your site, get more visitors, and get to the next level.

If You Build It ... Will They Come?
Six basic tips for getting people to come to your site and to keep them coming back.

Marketing Your Website
10 Ways to Run Your Own Advertising Campaign - Ads @ About
These tips will help you develop an advertising campaign for your Web site that fits in your budget and meets your needs.

Small Budget Advertising - Advertising @ About.com
There are ways to start an advertising campaign for your Web site that won't break the bank. These tips from the Advertising Guide at About will help you create ads for your site that fit within your budget.


This email is written by:
Jennifer Kyrnin
Web Design / HTML Guide
Email Me | My Blog | My Forum
 
Missing a lesson? Click here.

About U. is our collection of free online courses designed to help you learn a new skill, solve a problem, get something done, or just learn more about your world. Sign up now, and we will email you lessons on a daily or weekly basis.
You are receiving this email because you subscribed to the About.com 'Become a Freelance Web Designer' email. If you wish to unsubscribe, please click here.

About respects your privacy: Our Privacy Policy

Contact Information:
249 West 17th Street
New York, NY, 10011

© 2010 About.com
 

Advertisement

SEO Class: Check Your Pages for SEO One at a Time

|
If you can't see this email, click here

About.com


Check Your Pages for SEO One at a Time
Jennifer Kyrnin
From Jennifer Kyrnin, your Guide to Web Design / HTML
Now that you know the basics, you can go out and start optimizing your pages. The key things to remember are:
  • Optimize one page at a time
  • Optimize for only one keyword phrase for each page
  • Don't try to optimize your home page - aim for deep links to your site
  • Test your results after at least 2 weeks - to give the engines a chance to index your changes
  • Don't get discouraged - just stay focused on your content and provide the best that you possibly can
SEO Checklist
This SEO checklist will help you evaluate every page on your site for effective search engine optimization. The SEO checklist is divided into 5 sections - high priority, medium priority, and low priority SEO tips, things to avoid doing, and things to never do unless you want to be banned from search engines.


Search Engine Optimization Made Simple
Search engine optimization can be as simple or as hard as you want it to be. These five steps make search engine optimization easy and fun. You'll have your pages optmized for search quicker than you think. And you'll get more page views when you use these tips for search engine optimization.

95 SEO Tips and Tricks for Powerful Search Engine Optimizati
Search engine optimization (SEO) is often more of an art than a science. These 95 SEO tips and tricks will help you improve your search engine optimization. It can take a long long time for changes on your site to result in changes in your ranking, so, SEO can be frustrating to work on. But if you work on just one or two of these SEO tips every time you work on your pages, you'll eventually see good results.

More SEO Tips All the Time
This isn't the end. I learn more about SEO all the time and I write new articles regularly. Bookmark this page to see my SEO articles as they're posted.


This email is written by:
Jennifer Kyrnin
Web Design / HTML Guide
Email Me | My Blog | My Forum
 
Missing a lesson? Click here.

About U. is our collection of free online courses designed to help you learn a new skill, solve a problem, get something done, or just learn more about your world. Sign up now, and we will email you lessons on a daily or weekly basis.
You are receiving this email because you subscribed to the About.com 'SEO Class' email. If you wish to unsubscribe, please click here.

About respects your privacy: Our Privacy Policy

Contact Information:
249 West 17th Street
New York, NY, 10011

© 2010 About.com
 

Advertisement