Top CSS Tips

Category: CSS    |    2,191 views    |    Add a Comment  |   
  1. Use Reset.Css

    When it comes to rendering CSS styles, browsers like Firefox and Internet Explorer have different ways of handling them. reset.css resets all fundamental styles, so you starts with a real blank new stylesheets.

    Here are few commonly used reset.css frameworks - Yahoo Reset CSSEric Meyer’s CSS ResetTripoli

  2. Use Shorthand CSS

    Shorthand CSS gives you a shorter way of writing your CSS codes, and most important of all - it makes the code clearner and easier to understand.

    Instead of creating CSS like this

    1. .header {  
    2.       background-color#fff;  
    3.       background-imageurl(image.gif);  
    4.       background-repeatno-repeat;  
    5.       background-positiontop left;   
    6.     }  

    It can be short-handed into the following:

    1. .header {  
    2.       background#fff url(image.gif) no-repeat top left  
    3.     }  

    More - Introduction to CSS ShorthandUseful CSS shorthand properties

  3. Understanding Class And ID

    These two selectors often confuse beginners. In CSS, class is represented by a dot “.” while id is a hash ‘#”. In a nutshell id is used on style that is unique and don’t repeat itself, class on the other side, can be re-use. Read more…

     

Top 100 CSS Tips

Category: CSS    |    3,238 views    |    Add a Comment  |   

 

CSS Rounded Corners

Rounded corners is one of the most popular and frequently requested CSS techniques. There lots of ways to create rounded corners with CSS, but they always require lots of complex HTML and CSS. Here are easy ways to achieve this effect.

 

CSS Sprites

CSS sprites save HTTP requests by using CSS positioning to selectively display composite background images. To maximize accessibility and usability, CSS sprites are best used for icons or decorative effects.

Read more…

 

CSS Tricks

Category: CSS    |    2,841 views    |    3 Comments  |   

we have all come to learn many css tricks and techniques that help us. here you can find full list of top css tips and tricks.

 

1. Absolute positioning inside a relative positioned element.

Putting an absolutely positioned element inside a relatively positioned element will result in the position being calculated on its nearest positioned ancestor. This is an excellent technique for getting an element to “stick” in a certain spot where you need it, for instance, a header badge.

Read more about positioning:

2. Z-Index and positioning.

z-index can be somewhat of a mystery to developers. Often, you will find designers putting a very large z-index value on a div or element in order to try and get it to overlap another element. What we need to keep in mind, is that z-index only applies to elements that are given a “position” value. If you find an element will not adhere to a z-index rule you’ve applied, add “position:relative” or “position:absolute” to the troublesome div.

Read more about z-index:

3. Margin Auto

Using margin auto in a theme is a fantastic way to get an element centered on the screen without worrying about the users screen size. However, “margin: auto” will only work when a width is declared for the element. This also means to apply margin: auto to inline elements, the display first must be changed to block.

Read more…