NAING media creation
blog

CSS tricks

Now there have a lot of tricks for CSS to comply with different browsers such as IE6, IE7, Firefox, and Safari. Mostly majority uses the common browsers like Internet Explorer and Firefox. Therefore, what I would like to suggest is to make the CSS which you write at least look fine with these common browsers. That is, of course, I always check my website design. Here is some trick for CSS to make your site display properly in cross browser compatibility.

Here are some example of useful css.

Example 1:

  1. body
  2. { background:#336600; /* firefox */
  3. *background:#336600; /* IE 7 */
  4. _background:#ffffff; /* IE 6 */
  5. }

 

This example is quite easy and useful css code, although it doesn’t pass validation of CSS. What a shame. If you want to show you are professional, it better uses the validate CSS, I strongly suggest. Anyway, it works, try it.

Example 2:

  1. /* IE 6 */
  2. #box /**/{
  3. position: absolute;
  4. left: -210px;
  5. top: 230px;
  6. }
  7. /* firefox and IE 7 */
  8. [xmlns] #box {
  9. position: absolute;
  10. left: -210px;
  11. top: 211px;
  12. }

 
In this code, using /**/ mean to represent for IE6.

[xmlns] is using for firefox and IE 7.

Good luck for your CSS.

5 Responses to “CSS tricks”

  1. Hein Thu Aung Says:

    Thank you Ko Naing OO,

  2. KonstantinMiller Says:

    I think I will try to recommend this post to my friends and family, cuz it’s really helpful.

  3. Hayley Says:

    I don’t usually post but I enjoyed your blog a lot. :)

  4. Free Wii Says:

    Thanks for the great article - I enjoyed reading it! I always enjoy looking at this blog. :)

  5. free criminal background check Says:

    Easily, your post is really the freshest on this laudable topic. I agree with your conclusions and will eagerly look forward to your upcoming updates. Saying thank you will not be sufficient, for the wonderful lucidity in your writing. I will immediately subscribe to your feed to stay informed of any updates. Admirable work and much success in your business efforts!

Leave a Reply