Posts Tagged ‘learn css’

CSS 3 Rounded Corners

Tuesday, November 3rd, 2009

How to make Rounded Corners using CSS 3 ?

Using css 3 property, you can create a button with rounded corners or Borders in a matter of seconds, without having to use the image, which will spend a lot of your time.

With CSS 3, We can create Rounded Corners like css code below:

<html>
<head>
<title>Rounded Corner using CSS 3</title>
<style type="text/css">
  .rounded {
           width:200px;
           padding:5px;
           text-align:center;
           background:#dddddd;
           border:solid 1px #666666;
           border-radius: 10px;
           -moz-border-radius: 10px;
           -webkit-border-radius: 10px;
           }
</style>
</head>
<body>
   <div class="rounded">
      <h1>How to make Rounded Corner using CSS 3</h1>
   </div>
</body>
</html>

As you can see, all that you need to do is specify three CSS3 properties. Eventually, it will only be one; you have to use three now because different browsers use different property names.

The Result :

How to make Rounded Corner using CSS 3

What’s that CSS 3…?

Thursday, October 29th, 2009

We’ve all had to achieve some effect that required an extra handful of divs or PNGs. We shouldn’t be limited to these old techniques when there’s a new age coming. This new age includes the use of CSS3. In today’s tutorial, I’ll show you eleven different time-consuming effects that can be achieved quite easily with CSS3.

I’m sure you’ve heard of CSS in general. CSS3 isn’t that much different, in terms of syntax; however, the power of CSS3 is much greater. As you’ll see in these eleven techniques, you can have multiple backgrounds, dynamically resize those backgrounds, border radiuses, text shadows, and more!

CSS3 is the new kid in the stylesheet family. It offers exciting new possibilities to create an impact with your designs, allows you to use more diverse style sheets for a variety of occasions and lots more.

What We’ll Be Covering

Here are the 11 techniques that I’ll be showing you how to recreate with CSS3. I’ll show you how to create them using CSS 3 without   JavaScript 0r JQuery, . Remember – these effects will only work in modern browsers that implement these CSS3 features. Your best option is to view these with Safari 4, firefox 3.5.3-upper, Google Chrome.

  1. CSS 3 Rounded Corners
  2. CSS 3 Box Shadow
  3. CSS 3 Text Shadow
  4. CSS 3 Fancy Font
  5. CSS 3 Opacity
  6. CSS 3 RGBA/ CSS 3 background
  7. CSS 3 Background Size
  8. CSS 3 Multiple Backgrounds
  9. CSS 3 Columns
  10. CSS 3 Border Image
  11. CSS 3 Animations

CSS Margin

Thursday, October 8th, 2009

The CSS margin properties define the space around elements.
The margin clears an area around an element (outside the border). The margin does not have a background color, and is completely transparent.

The top, right, bottom, and left margin can be changed independently using separate properties. A shorthand margin property can also be used, to change all margins at once.

1.

div#sidebox { margin:10px; }

Code above shows that the four sides of the selector sidebox is 10 pixels between the border and the selector.

2.

div#sidebox { margin:10px 20px; }

Code above shows that the upper and lower limits of the sidebox selector is 10 pixels while the left and right borders within 20 pixels.

3.

div#sidebox { margin:10px 20px 30px 40px; }

or it could be way below:

div#sidebox { margin-top:10px; margin-right:20px;
margin-bottom:30px; margin-left:40px;}

Code above shows that the upper limit of the selector is 10 pixels sidebox, right limit is 20 pixels, the lower threshold is 30px and 40px is the left boundary.

4.

div#sidebox {margin-top:10px;}

Code above shows that the upper limit of sidebox selector is 10 pixels while the other boundary Default value. And other than margin-top, also can be with property margin-right, margin-bottom and margin-left.

Besides using px units (pixels) can also be a unit emphasis (em) or percentages (%), as an example:

div#sidebox {margin:1em 2%; }

The result? …
You can do experiments and test yourself on your browser. that way you will make the game more challenging.

CSS Background

Wednesday, October 7th, 2009

What Does CSS Background ?

Background property is to create the background effect on an HTML element.

CSS properties used for background effects: background-color, background-image, background-repeat,background-attachment, background-position.

There are several kinds of properties on the following background,

Look Examples in below:

  • Background Color, is to set the background of an element with a solid color.
    Example:

(more…)