Admin

May 26th

121 Comments

Share

Today will discuss about some basic properties of css3. Last week one of our reader asked me to post an article based on css3 basic and advanced properties so today we come up with some css3 basic properties.

1. Border Radius

Earlier we used to use images to get border radius, which is bit a long procedure and lots of codes are needed to complete this. But now with CSS3 Border Radius Property we can do it in second.

Browser Support : Firefox 3+, Chrome 4+, Safari 3.1+

Code

#border-radius {
width: 200px;
height: 150px;
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
}

Demo

2. Box Shadow

This is the new property of CSS3 which gives shadow to selected DIV. Using Box Shadow we can set the X and Y offset of shadow, color of shadow along with Blur in pixel.

Browser Support : Firefox 3.5+, Chrome 2+, Safari 4+

Code

#box-shadow {
width: 200px;
height: 150px;
-webkit-box-shadow: #244766 5px 5px 10px;
-moz-box-shadow: #244766 10px 10px 10px;
box-shadow: #244766 10px 10px 10px;
}

Demo

3. Text Shadow

This is the new property of CSS3 which gives shadow to Text. Using Text Shadow we can set the X and Y offset of shadow, color of shadow along with Blur in pixel.

Browser Support : Firefox 3.5+, Opera 9.6+, Chrome 2+, Safari 4+

Code

#text-shadow {
-webkit-text-shadow: #555 4px 4px 4px;
-moz-text-shadow: #555 4px 4px 4px;
box-text: #555 4px 4px 4px;
}

Demo

WD Desk

4. Text Stroke

This is the new property of CSS3 which gives stroke/outline to Text. Here we will use syntax as text-fill-color for color of text, text-stroke-color which gives color to the stroke and text-stroke-width for width of stroke/outline.

Browser Support : Chrome 2+, Safari 4+

Code

#text-stroke {
font-size:24px;
-webkit-text-fill-color: #000;
-webkit-text-stroke-color: #C00;
-webkit-text-stroke-width: 1px;
}

Demo

WD Desk

5. Linear Gradient

Linear Gradient gives a gradient to any HTML elements. Visit Webkit for more detail on this property.

Browser Support : Firefox 3.5+, Chrome 2+, Safari 4+

Code

#linear-gradient {
width: 200px;
height: 150px;
/* For Firefox */
background-image: -moz-linear-gradient(top, #F00, #F60);
/* For Safari/Chrome */
background-image: -webkit-gradient(linear,left bottom,left top,color-stop(0, #F60),color-stop(1, #F00));
}

Demo

6. Radial Gradient

This CSS3 Property gives a radial gradient to any selected element of XHTMl. Visit Webkit and Gecko for more detail on this property.

Browser Support : Firefox 3.5+, Chrome 2+, Safari 4+

Code

#radial-gradient {
width: 200px;
height: 150px;
background-image: -moz-radial-gradient(center 45deg, circle closest-corner, #F60 10%, #F00 70%);
background-image: -webkit-gradient(radial, center center, 10, center center, 90, from(#F60), to(#F00));
}

Demo

7. Rotate

This CSS3 Property allows any html element to rotate.

Browser Support : Firefox 3.5+, Chrome 2+, Safari 4+

Code

#rotate {
width: 200px;
height: 150px;
-webkit-transform: rotate(-10deg);
-moz-transform: rotate(-10deg);
}

Demo

8. Reflection

This CSS3 Property allows reflection of text or boxes.

Browser Support : Chrome 2+, Safari 4+

Code

#reflection {
font-size:24px;
color: #f00;
-webkit-box-reflect: below -5px -webkit-gradient(linear, left top, left bottom, from(transparent), to(rgba(100, 100, 100, 0.4)));
}

Demo

WD Desk

9. Resize

This CSS3 Property allows resizing of box on horizontal, vertical and both axis.

Browser Support : Chrome, Safari

Code

#resizing {
width: 200px;
height: 100px;
border:1px solid red;
overflow: hidden;
resize: both;
}

Demo

Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum lorem ipsum

10. Outline

When we style any element with outline then we can have a outline specified with offset to that particular element. Suppose we want to have an outline which is 5px away from the element box then we use outline property.

Browser Support : Firefox, Chrome, Safari

Code

#outline {
width: 200px;
height: 150px;
background-color:#F00;
outline: solid 1px #f00;
outline-offset: 5px;
}

Demo

We will Write Tutorials on CSS3 Animation in our upcoming articles.

Unlock the key of your success for budget web hosting exams & HP0-P14 by using our latest 642-583 and pass4sure 70-536 prep resources and scjp.

Author : Admin

121 Responses to “Impossible Things With CSS Now Possible With CSS3”

  1. JERRY says:

    .

    Buyno prescription…

  2. DAN says:

    prozac@and.diflucan.drug.interactions” rel=”nofollow”>…

    Buygeneric drugs…

  3. THOMAS says:

    aloe@vera.gel.benefits” rel=”nofollow”>.

    Buyit now…

  4. TROY says:

    long@term.prilosec.use” rel=”nofollow”>.

    Buygeneric drugs…

  5. MAX says:

    dangers@of.alphagan” rel=”nofollow”>..

    Buynow…

  6. RICKY says:

    .

    Buygeneric drugs…

  7. WESLEY says:

    methotrexate@and.placenta.acretia” rel=”nofollow”>.

    Buygeneric drugs…

  8. EDDIE says:

    motrin@for.61.pounds” rel=”nofollow”>…

    Buygeneric meds…

  9. ROLAND says:

    best@ay.to.take.extenze” rel=”nofollow”>…

    Buyit now…

  10. FRANCISCO says:

    femara@and.hives” rel=”nofollow”>..

    Buyno prescription…

  11. OLIVER says:

    side@effects.of.dog.medication.famotidine.and.flagyl” rel=”nofollow”>…

    Buygeneric drugs…

  12. ANTONIO says:

    pediatric@dosage.of.prednisolone” rel=”nofollow”>…

    Buyno prescription…

  13. NICK says:

    .

    Buyno prescription…

  14. KURT says:

    livingston@foot.care.bellmore” rel=”nofollow”>.

    Buyit now…

  15. ERNESTO says:

    Buygeneric drugs…

  16. Ehantelle says:

    Great…

    love your blog, http://berniece.fotopages.com/ ,Thanks again….

Leave a Reply