1. Simplified rules in font css
font-size: 1em;
line-height: 1.5em;
font-weight: bold;
font-style: italic;
font-varient: small-caps;
font-family: verdana,serif
you can simplify this:
font: 1em/1.5em bold italic small-caps verdana,serif
2.Add more than 1 class to html object
<p class="text side">...</p>
3.!important
override all other css statment and not working on IE.
margin-top: 3.5em !important; margin-top: 2em
4.Replace Text By Image
Sometime you need to use the image contains text that were made from separate font in Photoshop to show web more beautiful. But the ability of google search on your web will be lower. so how to be able to meet both the needs above. Very simple you just need to refer the following example.
<h1><span>Buy widgets</span></h1>
You can apply the following css:
h1
{
background: url(widget-image.gif) no-repeat;
}
h1 span
{
position: absolute;
left:-2000px
}
5. CSS positioning inside a Container
One of the best things about css that you can location an object inside another object. Quite Simpy you just need to set the css properties as follows.
#container
{
position: relative
}
and then you now place an object insde the container object and apply the css properties as follow.
#navigation
{
position: absolute;
left: 30px;
top: 5px
}
No comments:
Post a Comment