Posts Tagged ‘css border’

CSS 3 Borders Image Background

Friday, April 23rd, 2010

How to create borders style using image ?

Another exciting new border feature of CSS3 is the property border-image. With this feature you can define an image to be used instead of the normal border of an element. This feature is actually split up into a couple of properties: border-image and border-corner-image. These two values are shorthands for:

  • border-image:
    • border-top-image
    • border-right-image
    • border-bottom-image
    • border-left-image
  • border-corner-image:
    • border-top-left-image
    • border-top-right-image
    • border-bottom-left-image
    • border-bottom-right-image

border-image currently works in Safari and Firefox 3.1 (Alpha). The syntax to use it is:

border-image: url(border.png) 27 27 27 27 round round;

Which results in:

Lorem ipsum dolor sit amet.

or

border-image: url(border.png) 27 27 27 27 stretch stretch;

Which then results in:

Lorem ipsum dolor sit amet.

For those of you not so lucky as to be able to see this, here are screenshots of the two examples.
Number One :
border-image first example
Number Two :
border-image second example

CSS 3 Colored Borders Style

Friday, April 23rd, 2010

How to set colored borders style using CSS 3 ?

W3C has offered some new options for borders in CSS3, of which, next to rounded borders, border-color is also very interesting.

Mozila/Firefox has implemented this function, which allows you to create cool colored borders.

This is an example:

Mozilla/Firefox users should see a nice grey fading border on this box…

The CSS code for this is:

border: 8px solid #000;
-moz-border-bottom-colors: #555 #666 #777 #888 #999 #aaa #bbb #ccc;
-moz-border-top-colors: #555 #666 #777 #888 #999 #aaa #bbb #ccc;
-moz-border-left-colors: #555 #666 #777 #888 #999 #aaa #bbb #ccc;
-moz-border-right-colors: #555 #666 #777 #888 #999 #aaa #bbb #ccc;
padding: 5px 5px 5px 15px;

And of course, you can also do cool color stuff:

Mozilla/Firefox users should see a nicely fading red border on this box…

Css basic format

Wednesday, September 16th, 2009

What is the basic css formatting?

If you look really carefully HTML translation results in the browser is shaped box, inside the box can be divided into several areas such as Content, Padding, Border, and Margin.

From each of these areas can be formatted by using CSS style.

To clarify what the above of CSS format, see the illustration below:
css box style
Description:

  • In the most central area called the Content,
    Content can be either text or image, is also a combination of Text and Image.
  • Padding, Padding separates content with the Border.
  • Outside Padding, called the Border,
    Border is the line than the content in between the padding and margins.
  • The most outer area called the Margin,
    The margin between the border and separates the outer side.