The Power of CSS3
CSS3 has now been around a while and the browser support has grown widely. It gives power to developers to create design elements without the need for using photoshop. .
Example:
.yourdiv {
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
}
Border Radius |
|||
Border radius can be added to an element to add a rounded corner. You can choose any corner from one to all corners. You can even turn a square into a circle by setting your border radius to half the width of your object. | |||
<div style=”
width: 150px; height: 150px; border-radius: 100px; border: 3px solid #000000; background-color: #5cdb55;“></div> <div style=”
width: 150px; height: 150px; border-radius: 60px; border: 3px solid #000000; background-color: #db5555;“></div> <div style=”
width: 150px; height: 150px; border-radius: 60px 60px 60px 0; border: 3px solid #000000; background-color: #dbb455;“></div> |
|||
Box Shadows |
|||
Box shadows can be used to replace the drop shadow that you would use in photoshop. You can change the colour, opacity and the direction of the shadow. | |||
<div style=”
width: 150px; height: 150px; border-radius: 0 60px 60px 60px; border: 3px solid #000000; background-color: #9155db; box-shadow: 0 5px 10px 0 rgba(0, 0, 0, 0.9);“></div> <div style=”
width: 150px; height: 150px; border-radius: 0 60px 0 60px; border: 3px solid #000000; background-color: #db55cd; box-shadow: 5px 10px 5px 10px rgba(0, 0, 0, 2);“></div> <div style=”
width: 150px; height: 150px; border-radius: 0 60px 60px 0; border: 3px solid #000000; background-color: #55d9db; box-shadow: inset 10px 10px 5px 0px rgba(0,0,0,0.75);“></div> |
|||
Shadow Box |
|||
|
|||
Creating Buttons |
|||
Below are a few practical examples of how to use border-radius and box-shadow to create buttons for use on your website. | |||
.tpc_button_one { .tpc_button_one:hover { .tpc_button_two { .tpc_button_two:hover { .tpc_button_three { .tpc_button_three:hover { |
|||