To add rounded corners to an element using CSS, just add the following code to your CSS
Of course, change the values (10px) to whatever value you want to change the corner radius.
If a browser doesn’t support rounded corners, it will just show square corners.
For more information, visit http://www.css3.info/preview/rounded-border/
To add a gradient to an element using CSS, just add the following code to your CSS
If a browser doesn’t support gradients, it will just display the background color.
To change the direction and other values of the gradient, check out http://webdesignerwall.com/tutorials/cross-browser-css-gradient.
Here are some different way to horizontally center HTML elements:
<div style=”margin: 0 auto; width:500px; height: 500px;”> some text </div>
The div is centered but the text within it isn’t.
<div style=”margin: 0 auto; text-align: center; width:500px; height: 500px; ”>some text </div>
The div and the text within it are centered. [..]
To add a drop shadow to an element using CSS, just add the following code to your CSS
If a browser doesn’t support drop shadows, it just won’t show them.
To change the direction and size and opacity of the drop shadow, tweak the values. Learn more at http://www.css3.info/preview/box-shadow/
Say you want to set the background color of something to black. In CSS, you might write something like:
But, what if you wanted the color to be less dark while showing whatever is underneath it like what you’d get by specifying 50% opacity in Photoshop. To do that, do the following:
The first 3 parameters are the red, green and blue values and the fourth is the alpha transparency from 0 to 1.