Web Development: CSS Floats

Published on Sep 2, 2009   //  Development

WordPress Development

In a previous article, we briefly went over CSS Floats. However, they deserve a more in-depth look, as they can be useful (and sometimes tricky).

CSS Floats allow you to position an object to the left or right, and have another object directly opposite (horizontally, speaking) it (on the same imaginary “top line”). We can use the floats using the float property in CSS. Let’s have a look at some example markup to apply this property to.

[html]<div id="left"><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed ac dui erat. Vivamus dui neque, laoreet volutpat tempor vel, facilisis eget tortor. Proin imperdiet mi non enim consequat tristique.</p></div>

<div id="right"><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed ac dui erat. Vivamus dui neque, laoreet volutpat tempor vel, facilisis eget tortor. Proin imperdiet mi non enim consequat tristique.</p></div>

<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed ac dui erat. Vivamus dui neque, laoreet volutpat tempor vel, facilisis eget tortor. Proin imperdiet mi non enim consequat tristique.</p>[/html]

Now, say we want to position the first div to the left, the second to the right and the third underneath. We would do something like this (you’d have to play with the widths of the floated divs):

[css]#left {
float: left;
}
#right {
float: right;
}[/css]

Which is great, #left will be on the left and #right will be on the right. However, you may encounter a problem with the content thats below these float divs. Content below the floated objects may wrap onto the floated object’s line, creating an unsightly result.

To resolve this we will add the following markup after our floated divs:

[html]<div class="clear"></div>[/html]

Then, in our CSS:

[css].clear {
clear: both;
}[/css]

CSS floats are a useful feature when coding designs and wrapping text around images (just use one float, and no “clear”). While they can sometimes be a bit tricky, it’s usually a simple fix and the pros outweigh the cons.

Business 101: The Bright Side of the Recession

Published on Sep 1, 2009   //  Business Topics
Off

It doesn’t take a financial expert to figure out that our economy has seen better days. Many companies and individuals are going through some rather tough times and you may feel tempted to throw in the towel and call it a day. It’s easy to get depressed when you see that your financial assets are dwindling. That’s obvious.

However, just as it is easy to see the glass as half-empty, you can also reverse you thinking and see the glass as half-full. As a result of this recession, many businesses have begun to look for ways to make their operations more efficient. They are finally starting to see places where they are spending too much money on unnecessary expenses, so they can now take the opportunity to streamline the business model into one that is more efficient.

On the other side of the coin, businesses are more motivated than ever to explore possible opportunities for growth that they may not have explored otherwise. They are looking to capture markets and demographics that were once not even on their radar. These opportunities can be utilized and while overall revenues may not be as high as they may have been in previous years, it is still possible to generate a handsome profit if the business is run well and in tune with the current economy.

Most people know how to handle a boom. They know how to handle the good life when the money keeps pouring in and it seems like the dream will never end. However, most people also don’t know how to handle things when the situation isn’t quite so positive. Learn how you can capitalize on these down times and learn how you can better manage your business in the long run.

Page 6 of 6« First...23456