Web Development: CSS Short Form

Published on Feb 24, 2009   //  Development
Off

Web Development

Today we’ll be talking about the short form of properties/values. While we have briefly touched on this topic in past articles, I want to go over it a bit more in-depth. Using CSS short form is a way to code faster and more efficiently (as it results in smaller stylesheet filesizes, which are faster to download).

Most property families that have multiple related properties will have an all encompassing property that allows you to specify values for all or most of the properties in the same family. These short form properties usually have different syntaxes, so you’ll have to remember them. We’re going to go over a few so that you can get the feel for them.

Margin and Padding

While you can specify different top, bottom, left and right values for margin and padding, that can be a tedious amount of typing to little result. It is much easier to use the short form of these properties. For these properties, you can either specify one, two or four values. Which look like this:

One Value

[code='css']#element {
margin: 5px;
padding: 5px;
}[/code]

A margin and padding of 5px will be applied to all sides.

Two Values

[code='css']#element {
margin: 10px 2px;
padding: 10px 2px;
}[/code]

A margin and padding of 10px will be applied to the top and bottom, while a margin and padding of 2px will be applied to the left and right.

Four Values

[code='css']#element {
margin: 2px 5px 10px 15px;
margin: 2px 5px 10px 15px;
}[/code]

In this example, and margin and padding of 2px will be applied to the top, 5px to the right, 10px to the bottom and 15px to the left. The values are specified in a clockwise rotation starting from the top.

Border

The border property can only accept one value, which is used for all four sides, however, we can specify the border width, style and colour separately in short hand form. For this we use the border-width, border-style and border-color properties. The syntax of the values is similar to margin and padding, in that you can specify one, two or four values, and they will be used in the same order.

[code='css']#element {
border-width: 1px 5px 7px 3px;
border-style: solid dashed dotted double;
border-color: #000 #0099CC #CCC #F9F9F9;
}[/code]

Background

The background property encompasses the background-color, background-image, background-repeat, background-attachment and background-position properties.

[code='css']body {
background: #0099FF url('background.png') repeat-x scroll top center;
}[/code]

Concluding…

Unless I think of something we missed in the CSS topic before next week, this marks an end to our CSS series. However, we’ll will be using CSS in upcoming series. If you want to learn more about CSS, W3 Schools and the SitePoint CSS Reference are great places to look.

Hear the Love BlueFur Style

Published on Feb 23, 2009   //  Contest

edifierspeakers

I won these Edifier e2100 speakers and instead of keeping them I decided to continue with this months feel the love theme. To qualify for this contest all you need to do is post a comment in this thread with how music effects your life.

The best comment will be chosen next Monday and a winner will be announced. To be sure your notified of the winner I suggest you subscribe to our RSS feed or join our email newsletter.

Great Gadgets: Mini Microphone for iPod

Published on Feb 23, 2009   //  Gadgets

imic

Most people are familiar with using an Apple iPod for listening to audiobooks and music tracks, but that little portable device is also capable of recording sound too. The only trouble is that the iPod doesn’t come with a microphone of its own, so what is the rogue interviewer to do?

Well, they can check out the Mini Microphone from USB Fever. It’s marketed as a Mini Microphone for the iPhone 3G, though I’m not entirely sure how useful it would be for a cell phone that already has a microphone. The Mini Microphone has also been tagged to work with the iPod nano 4G, iPod Classic 120G, and the iPod touch 2G. It’s not perfectly clear whether it would work with other models of iPod as well.

It’s supposed to be completely plug-and-play, so all you have to do is insert the little nub of a microphone into the the headphone jack on your chosen iPod. It’s very small, of course, so you will have no trouble carrying it around. Just try not to lose it.

In order for the Mini Microphone to wok with the second-generation iTouch, you’ll need to download and install software that will handle the voice recorder function, such as iTalk Recorder or Easy Recorder. The iPod nano 4G apparently has pre-loaded software for recordings. For more info on the $14.99 Mini Mic, check out the product page.

Twitter Question of the Week

Published on Feb 22, 2009   //  Polls
Off

This week on twitter I asked, If you owned a business would you pay someone to twitter for you?

Here is what was said…

danudey @bluefur As with all tasks involving interacting with customers, I would delegate it to someone passionate about the company and/or product.
michaelkwan @bluefur I don’t see why not. It’s no different than hiring a PR rep to handle emails, press releases, etc.
Thinkreferrals @bluefur if I had no time to be active on Twitter, of course I would pay someone
BradyV @bluefur Nope, cause I like twittering for myself.
chrisjacobson @bluefur I’d Twitter myself, it’s not that hard. :)
rayebersole @bluefur No, I would do it myself. Look at you for example or Evan from Twitter.
littlefluffycat @bluefur, they would have to be special; tweets should be the “voice” of a business. :)
kalamazu @bluefur where s the fun in that?
gosquared @bluefur I think they would have to do more than just tweeting – as a “community manager” they would also look after blog/forum comments
anjan01 @bluefur not at all. He might understand twitter better than me but definitely won’t understand my business to the extent I know it!
nikkideevah @bluefur it seems like the new cliche…

Would you pay someone to twitter for you?

Weekend Projects: How to Give Away an Ebook

Published on Feb 22, 2009   //  Weekend Projects
Off

Weekend Project

I am sure you have gone to sites and see that they are giving away an ebook if you sign-up for their newsletter or purchase some service. I am sure a few of you have wondered how you would go about doing that. So here it is…

1. Understand your niche. If your not sure who you customer is or what they want then find out by doing polls and research of your current site visitors.

2. Start a mailing list. If you do not have one already then start building it today. You can use a free service like Feedburner’s or a paid service like AWeber.

3. Develop or buy an eBook. If you have the time to develop your own book you can do that with a word processor tool and then publish using Acrobat or some other PDFing software. If you do not have the time you can browse bookswealth.com for ebooks with Master Reseller Rights. With these rights you can give the book away for free and the cost of the ebooks on the site are between $2 to $3.

4. Setup your welcome email to your newsletter to include a link to where they can download your ebook.

5. Add a link, banner or button to join your newsletter.

Once you do this you will see an increase in the number of sign-ups presuming you picked an ebook that fits your visitors needs.

If you get stuck leave a note in the comments or catch me on twitter.

Friday Funny

Published on Feb 20, 2009   //  Cartoon

A cartoon created by artist Randy Glasbergen.

techsupport2

If you have an idea for a future comic or would like to submit your own BlueFur cartoon let us know in a comment.

Page 3 of 1212345...10...Last »