May 07

Huh! sick and tired of all the methods to make the ‘Round Corner Box’ in HTML. If you put a query in search engine you will get thousands of result on how to go about it. Some tutorials explain you how this can be achived by using HTML + CSS + JS + images and other by using HTML + CSS + images. Almost all of these will be using 2 to 8 images to attain the desired result. The most popular one was with four images without JS. See my posting ‘Round Corner Stretchable Box‘ on Feb 19th, 2008. What if you can create a Round Corner Box without the use of JS nor images?

As I was stumbling thru the sites I came across the listings for the Round Corner Box in SmileyCat. My eyes got stuck in one of the listing. Achieve the round corner with no images and that too without the use of JS. WOW!!! this was my first reaction. I have gone thru the tutorial and with shamefaced I thought why couldn’t I think about this method when I was spending hours on research to achieve this without the use of images. Read More

written by admin \\ tags: , , , , , , , , , , , ,

Bookmark this article! [?]

BlinkbitsBlinkListsBlogLinesBlogmarksBuddymarksCiteULikeCo.mmentsDel.icio.usDiggDiigo

FacebookFarkFeed Me LinksFurlGoogleGraveeLinkagogoma.gnoliaNetvouzNewsvine

OnlyWirePropellerRawsugarRedditRojoSimpySlashDotSphinnSpurlSquidoo

StumbleUponTailrankTagglyTagtoogaTechnoratiYahoo

May 05

1. Divide and conquer your code
First consider the structure of your layout and identify the most important modules in your CSS-code. In most cases it’s useful to choose the order of CSS-selectors according to the order of divisors (div’s) and classes in your layout. Before starting coding, group common elements in separate sections and title each group. For instance, you can select Global Styles (body, paragraphs, lists, etc), Layout, Headings, Text Styles, Navigation, Forms, Comments and Extras.

2. Define a table of contents
To keep an overview of the structure of your code, you might want to consider defining a table of contents in the beginning of your CSS-files. One possibility of integrating a table of contents is to display a tree overview of your layout with IDs and classes used in each branch of the tree. You may want to use some keywords such as header-section or content-group to be able to jump to specific code immediately.

Defining a table of contents you make it particularly easier for other people to read and understand your code. For large projects you may also print it out and have it in front of you when reading the code. When working in team, this advantage shouldn’t be underestimated. It can save a lot of time — for you and your colleagues.

3. Define your colors and typography
Since we don’t have CSS constants yet, we need to figure out some way to get a quick reference of “variables” we are using. In web development colors and typography can often be considered as “constants” — fixed values that are used throughout the code multiple times.

Create a color glossary - a quick reference to the colors used in the site to avoid using alternates by mistake and, if you need to change the colors, you have a quick list to go down and do a search and replace. Alternatively, you can also describe color codes used in your layout. For a given color, you can display sections of your site which are using this color. Or vice versa — for a given design element you can describe the colors which are used there.

4. Order CSS properties
When writing the code often it’s useful to apply some special formatting to order CSS properties — to make the code more readable, more structured and therefore more intuitive. There is a variety of grouping schemes developers use in their projects. Some developers tend to put colors and fonts first; other developers prefer to put “more important” assignments such as those related to positioning and floats first. Similarly, elements are also often sorted according to the topology of the site and the structure of the layout. Some developers use a more interesting approach — they group properties in an alphabetical order.

Whatever grouping format you are using, make sure you clearly define the format and the objective you want to achieve. Your colleagues will thank you for your efforts.

5. Indentation is your friend!
For better overview of your code you might consider using one-liners for brief fragments of code. This style might produce messy results if you define more than 3 attributes for a given selector. However, used moderately, you can highlight dependencies between all elements of the same class. This technique will dramatically increase code readability when you have to find some specific element in your stylesheet.

written by admin \\ tags: , , , , , , , , , , , ,

Bookmark this article! [?]

BlinkbitsBlinkListsBlogLinesBlogmarksBuddymarksCiteULikeCo.mmentsDel.icio.usDiggDiigo

FacebookFarkFeed Me LinksFurlGoogleGraveeLinkagogoma.gnoliaNetvouzNewsvine

OnlyWirePropellerRawsugarRedditRojoSimpySlashDotSphinnSpurlSquidoo

StumbleUponTailrankTagglyTagtoogaTechnoratiYahoo

Apr 15

Outline

Quite frankly, this property has dropped off the existence of the design radar. Mainly because of lack of browsers supporting this CSS 2.1 standard (yep, it’s an actual property), but nonetheless, it too has a shorthand property. This property follows the exact same (or same exact - they mean the same thing) specification as the ‘border’ shorthand property. But, for purposes of this being a Guide, it must be here. So:

outline properties

element {
outline-width: number+unit;
outline-style: (numerous);
outline-color: color || #hex || (rgb / % || 0-255);
}

Outline written as shorthand:

outline shorthand property

element {
outline:3px dotted gray;
}

written by admin \\ tags: , , , , , , , , , , , , , , , , , ,

Bookmark this article! [?]

BlinkbitsBlinkListsBlogLinesBlogmarksBuddymarksCiteULikeCo.mmentsDel.icio.usDiggDiigo

FacebookFarkFeed Me LinksFurlGoogleGraveeLinkagogoma.gnoliaNetvouzNewsvine

OnlyWirePropellerRawsugarRedditRojoSimpySlashDotSphinnSpurlSquidoo

StumbleUponTailrankTagglyTagtoogaTechnoratiYahoo

Apr 13

Margin and Padding

These are by far the easiest. Just think about the hands of a clock starting at noon, and follow the hour. For the sake of brevity, we’ll be working with margin (since it’s a shorter word). So for all cases of margin, the same rules apply to padding.

margin properties.

element {
margin-top: number+unit;
margin-right: number+unit;
margin-bottom: number+unit;
margin-left: number+unit;
}

… combined into the margin superpowers:
the margin shorthand property

/* top right bottom left */

element {
margin: auto auto auto auto;
}

Of course, you may declare your margin with one, two, three, or four values. Here is how each scenario will be played out:
margin fun

/* adds a 10px margin to all four sides */

element {
margin:10px;
}

/* adds a 20px margin to top and bottom and a 5px margin to left and right */

element {
margin:20px 5px;
}

/* adds a 50px margin to top and a 10px margin to left and right and a 300px margin to bottom */

element {
margin:50px 10px 300px;
}

written by admin \\ tags: , , , , , , , , , , , , , , , , , ,

Bookmark this article! [?]

BlinkbitsBlinkListsBlogLinesBlogmarksBuddymarksCiteULikeCo.mmentsDel.icio.usDiggDiigo

FacebookFarkFeed Me LinksFurlGoogleGraveeLinkagogoma.gnoliaNetvouzNewsvine

OnlyWirePropellerRawsugarRedditRojoSimpySlashDotSphinnSpurlSquidoo

StumbleUponTailrankTagglyTagtoogaTechnoratiYahoo

Apr 11

Font

Font is perhaps the trickiest. However, it follows the same rules as the background shorthand property. All that you do not declare will have unexplicit values. Here is the font shorthand specification:

font properties

element {
font-style: normal || italic || oblique;
font-variant:normal || small-caps;
font-weight: normal || bold || bolder || || lighter || (100-900);
font-size: (number+unit) || (xx-small - xx-large);
line-height: normal || (number+unit);
font-family:name,"more names";
}

The default values for the font shorthand property are as follows:

default font property values

element {
font-style: normal;
font-variant:normal;
font-weight: normal;
font-size: inherit;
line-height: normal;
font-family:inherit;
}

And of course without any further ado. The font shorthand property syntax:

the font shorthand property

element {
font:
normal
normal
normal
inhert/
normal
inherit;
}

Here is where it gets tricky. The fact that font-style, font-variant, and font-weight all come “normal” out of the box, you may need to pay a little more close attention when you’re styling elements that come with default browser styles like <h1> - <h6> or <strong> and <em>. For example, styling the strong element:
strong element styled with font

strong {
font:12px verdana;
}

By writing the above into your style sheet, you will be inexplicit removing the font-weight:bold default browser style that is applied to strong elements.

Last but not least (for -font- that is), a real world example:

font shorthand property example (inexplicit)

p {
font:bold 1em/1.2em georgia,"times new roman",serif;
}

This would be the same as declaring the following properties:

the font shorthand property (explicit)

p {
font-style:normal;
font-variant:normal;
font-weight:bold;
font-size:1em;
line-height:1.2em;
font-family:georgia,"times new roman",serif;
}

written by admin \\ tags: , , , , , , , , , , , , , , , , , ,

Bookmark this article! [?]

BlinkbitsBlinkListsBlogLinesBlogmarksBuddymarksCiteULikeCo.mmentsDel.icio.usDiggDiigo

FacebookFarkFeed Me LinksFurlGoogleGraveeLinkagogoma.gnoliaNetvouzNewsvine

OnlyWirePropellerRawsugarRedditRojo