20 Useful CSS Tips For Beginners

Advertisement

useful css for beginners

In the old days, we depend a lot of on developers and programmers to help update the website, even when it’s just a minor one. Thanks to the CSS and it’s flexibility, styles can be extract independently away from the codes. Now, with some basic understanding of CSS, even a novice can easily change the style of a website.

Whether you are interested in picking up CSS to create your own website, or merely to tweak your blog’s look and feel a little – it’s always good to start with the fundamentals to gain a stronger foundation. Let’s take a look at some CSS Tips we thought might be useful for beginners. Full list after jump.

  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 CSS, Eric Meyer’s CSS Reset, Tripoli

  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

    .header {
          background-color: #fff;
          background-image: url(image.gif);
          background-repeat: no-repeat;
          background-position: top left; 
        }

    It can be short-handed into the following:

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

    MoreIntroduction to CSS Shorthand, Useful 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.

    MoreClass vs. ID | When to use Class, ID | Applying Class and ID together

  4. Power of <li>

    <li> a.k.a link list, is very useful when they are use correctly with <ol> or <ul>, particulary to style a navigation menu.

    MoreTaming Lists, Amazing LI

  5. Forget <table>, try <div>

    One of the greatest advantage of CSS is the use of <div> to achieve total flexibility in terms of styling. <div> are unlike <table>, where contents are ‘locked’ within a <td>’s cell. It’s safe to say most <table> layouts are achievable with the use of <div> and proper styling, well maybe except massive tabular contents.

    MoreTables are dead, Tables Vs. CSS, CSS vs tables

  6. CSS Debugging Tools

    It’s always good to get instant preview of the layout while tweaking the CSS, it helps understanding and debugging CSS styles better. Here are some free CSS debugging tools you can install on your browser: FireFox Web Developer, DOM Inspector, Internet Explorer Developer Toolbar, and Firebug.

  7. Avoid Superfluous Selectors

    Sometimes your CSS declaration can be simpler, meaning if you find yourself coding the following:

    • ul li { ... }
    • ol li { ... }
    • table tr td { ... }

    They can be shorten down to just

    • li { ... }
    • td { ... }

    Explanation: <li> will only exist within <ul> or <ol> and <td> will only be inside <tr> and <table> so there’s really not necessary to re-insert them.

  8. Knowing !important

    Any style marked with !important will be taken into use regardlessly if there’s a overwriting rule below it.

    .page {	background-color:blue !important;	background-color:red;}

    In the example above, background-color:blue will be adapted because it’s marked with !important, even when there’s a background-color:red; below it. !important is used in situation where you want to force a style without something overwriting it, however it may not work in Internet Explorer.

  9. Replace Text with Image

    This is commonly practice to replace <h1>title</h1> from a text based title to an image. Here’s how you do it.

    h1 {
    text-indent:-9999px;
    background:url("title.jpg") no-repeat;
    width:100px;
    height:50px;
    }

    Explanation: text-indent:-9999px; throws your text title off screen, replaced by an image declared by background: {...} with a fixed width and height.

  10. Understand CSS Positioning

    The following article gives you a clear understanding in using CSS positioning – position: {...}

    MoreLearn CSS Positioning in Ten Steps

  11. CSS @import vs <link>

    There are 2 ways to call an external CSS file – respectively using @import and <link>. If you are uncertain which method to use, here’s few articles to help you decide.

    MoreDifference Between @import and link

  12. Designing Forms in CSS

    Web forms can be easily design and customize with CSS. These following articles show you how:

    MoreTable-less form, Form Garden, Styling even more form controls

  13. Get Inspired

    If you are looking around for nicely designed CSS-based website for inspiration, or just simply browsing to find some good UI, here are some CSS showcase site we recommend:

    Need more? Here’s a round up of 74 CSS Galleries.

  14. Rounded Corners in CSS

    This following article gives you an idea how to create cross-browser compatible rounded borders with CSS.

  15. Keep CSS Codes Clean

    If your CSS codes are messy, you are going to end up coding in confusion and having a hard time refereing the previous code. For starters, you can create proper indentation, comment them properly.

    More12 Principles For Keeping Your Code Clean, Format CSS Codes Online

  16. Typography Measurement: px vs em

    Having problem choosing when to use measurement unit px or em? These following articles might give you a better understanding on the typography units.

    MoreUnits of Measurement in CSS, CSS Font size explained, Using Points, Pixels, Ems, or Percentages for CSS Fonts

  17. CSS Browsers Compatibility Table

    We all know each browser has different ways of rendering CSS styles. It’s good to have a reference, a chart or a list that shows the entire CSS compatibility for each browser.

    CSS support table: #1, #2, #3, #4.

  18. Design Multicolumns in CSS

    Having problem getting the left, middle and right column to align properly? Here are some articles that might help:

  19. Get a Free CSS Editors

    Dedicated editors are always better than a notepad. Here are some we recommend:

    More – Simple CSS, Notepad ++, A Style CSS Editor

  20. Understanding Media Types

    There are few media types when you declare CSS with <link>. print, projection and screen are few of the commonly used types. Understanding and using them in proper ways allow better user accessibility. The following article explains how to deal with CSS Media types.

    MoreCSS and Media Types, W3 Media Types, CSS Media Types, CSS2 Media Types

Related Contents

Sponsors

Posted by hongkiat in How-To , at 03.16.09

Tags: , , ,

Comments

  1. abdusfauzi March 16th, 2009

    this is nice! need to bookmark this. :)

    Reply
  2. CincauHangus March 17th, 2009

    finally something i wana know for a long long time. =p

    Reply
  3. Dollar March 17th, 2009

    Thanks a lot! This is really very useful.

    Bookmarked :)

    Reply
  4. Steven March 17th, 2009

    Submit Css is also a great place to find some good inspiration. It’s my favorite gallery!!!

    Reply
  5. Remy Overkempe March 17th, 2009

    Great resource! Thanks :)

    Reply
  6. IHeartTopTens March 17th, 2009

    Great Article. Added to IHeartTopTens.com : http://www.ihearttoptens.com/view.php?uid=23

    Reply
  7. Pinky March 17th, 2009

    great sharing..thanks

    Reply
  8. PCStuffBlog March 17th, 2009

    CSS tips and tutorials is never enough. There are still the web developing books, what missing CSS chapters. That is wrong! CSS is base and very powerful website tool.
    Thanks for this tips!

    Reply
  9. Jason Bartholme March 17th, 2009

    Some good links there. I have been using CSS for years and didn’t know you could combine the background properties as listed.

    Thanks!

    Reply
  10. Klikrnet March 17th, 2009

    CSS has been a big mystery to me until I see this post. Things like div, class, float, repeat,… always intimidate me somehow.

    So I choose tables most of the same for the sake of familiarity. Thanks a lot for sharing!

    Reply
  11. Dean March 17th, 2009

    List failed as soon as it began. reset.css?

    Reply
  12. burnz March 17th, 2009

    Another useful article… Refresh my memory about css thingy…

    Reply
  13. Abhilash March 17th, 2009

    I like it very much

    Reply
  14. Brian March 17th, 2009

    these are just basics but very important stuffs to know. thank you.

    Reply
  15. teddY March 17th, 2009

    Thanks for the great compilation! Maybe you will want to add another point on reset styles since they’re quite important, as well as CSS frameworks (Blueprint, 960 and etc). It’s enlightening that you touched on the <link> VS @import for importing CSS stylesheets into a webpage.

    p/s: A good recommendation of those who’re an FF user and is too lazy to get accustomed to a CSS editor is to get a plugin called Firebug. So far it works just fine for me :)

    Reply
  16. teddY March 17th, 2009

    Sorry about the reset styles, I missed out the first line lol. Oh, and just another note: I’m glad that you didn’t dwell into the CSS formatting debate, whether to use single-line, multiple-lines, with tabs or without tabs. It’s just personal choice, not professional ethics heh.

    Reply
  17. Mickael Pinto March 17th, 2009

    Thanks for all !

    Reply
  18. Woodstock real estate March 17th, 2009

    Thanks for the great CSS tips!!

    Reply
  19. Amelia Vargo March 18th, 2009

    Thanks for all this, it is really useful! I didn’t know you could use css for rounded corners, I’ve always just used javascript in the past, I think I’ll have to give css a try!

    I don’t think there should be a choice between ems and pixels. Ems are a little harder to work with, but the benefits for people who need /want to resize their text outweigh (for me anyway) the benefits of using something that is easier for the designer. Nuff said….

    Reply
  20. joe March 18th, 2009

    Finally, something usefull again, thanks!

    Reply
  21. dlv March 18th, 2009

    really nice post, good starting information
    i like it

    Reply
  22. Online Resources March 19th, 2009

    Another great post. This is not only for css beginners but old time css users will find this compilation very useful. Bookmarked it.

    Reply
  23. dev March 19th, 2009

    Great post

    Reply
  24. Webmaster Blog March 20th, 2009

    Thank you.Very nice post.

    Reply
  25. faruksal March 20th, 2009

    Thank you very much:))

    Reply
  26. ladyfox14 March 20th, 2009

    This is an awesome post. Extremely useful and very clear to understand. +1

    Reply
  27. unie March 20th, 2009

    kerennnnnnnnnnnnnnnnnnnnnnnnnnnnnn………… :D

    Reply
  28. Laith Ibrahim March 22nd, 2009

    Great List. Thanks!

    Reply
  29. Rahul March 22nd, 2009

    These are great tips for CSS for beginners as well as CSS coders as well.

    Reply
  30. 爱月 March 24th, 2009

    i’ve translated it into Chinese , if u don’t like ,tell me & i’ll dellete it immediately ~ the address is : http://moon-blog.cn/20_useful_css_tips_for_beginners/

    Reply
  31. Liza March 29th, 2009

    Grate list!
    I cant agree on nr.2 but otherwise it’s top notch :)

    Reply
  32. flikteoh March 29th, 2009

    Thank you ! Very informative post!

    Reply
  33. Gompyi March 29th, 2009

    Nice!

    Reply
  34. anarm March 31st, 2009

    great! thank you because share this great tips. 2 thumbs up.

    Reply
  35. Luiz April 1st, 2009

    I’ve translated your post.

    Reply
  36. Callum Chapman April 3rd, 2009

    bookmarked for future reference (i.e. when I have time to learn css!). Sure this will come in handy though, thanks!

    Reply
  37. fonso gfx April 5th, 2009

    Wonderful post.

    Reply
  38. Przemek April 7th, 2009

    Fantastic jobs!

    Reply
  39. CMS Themes April 7th, 2009

    One hell of a list! Thanks for rounding them up.

    Reply
  40. YSlove April 11th, 2009

    Thanks! This is has more help to me!

    Reply
  41. koronghejo April 11th, 2009

    thank you…..:)

    Reply
  42. Dyvantity April 20th, 2009

    Nice tips, I used them for my French website http://www.dyvantity.com.
    Dugg and Thumed Up

    Reply
  43. Serkan April 21st, 2009

    Wonderful and Fantastic! post.

    Reply
  44. WORDPRESSGALA April 22nd, 2009

    Very useful! Great resource. Thanks!

    Reply
  45. Jason April 23rd, 2009

    Great resource, pity about the ads though it slows down the entire site.

    Reply
  46. jonmulholland April 24th, 2009

    Some very handy tips here. Thanks for the great article!

    Reply
  47. baloot April 24th, 2009

    very nice collection mate!
    thanks a lot.
    i bookmark this for my future resource… :D

    Reply
  48. Keith April 24th, 2009

    Great list. I’ve been looking for a list like this. Thanks!

    Reply
  49. jelumalai April 24th, 2009

    Good post, this for experience guy also not only beginners, Keep it up.

    I book marked this URL

    Reply
  50. Sin April 27th, 2009

    I like Crimson Editor to replace notepad.
    Thanks for the great post!
    Digging now

    Reply
  51. M.Major Karthik May 4th, 2009

    Very useful and impressive .

    Reply
  52. saravana Kumar May 4th, 2009

    very use full tips.Want some more…Thanks.:-)

    Reply
  53. Syed Nisar May 7th, 2009

    thanks a lot, its really helpful for me……………..

    Reply
  54. Adrian June 4th, 2009

    Thanks for the article, it is very resourceful. Very well done.

    Reply
  55. hslOLa June 21st, 2009

    nice!

    Reply
  56. Jas July 27th, 2009

    this is great stuff – i didnt know the difference between ID and Class, thanks for clearing that up

    Reply
  57. Türk's Bilişim; Web Tasarım September 2nd, 2009

    this very thank you.

    Your Web Site professional…

    Reply
  58. Ertan (Erkasoft Web Tasarım) September 7th, 2009

    Thank you, this is very good tips for the beginners.

    Reply
  59. Scot Hacker September 22nd, 2009

    FYI “li” stands for “list item,” not “link list”. Lists don’t need to include links…

    Reply
  60. ravi September 25th, 2009

    Thanks a lot! This is really very useful.

    Reply
  61. Gsm Tamircisi September 27th, 2009

    this is thank you..

    very good..

    Reply
  62. WebpageLottery October 13th, 2009

    I agree with div is a lot more flexible than table. I use div to replace table most of the time now.

    Reply
  63. Ezuca October 17th, 2009

    Thanks. I have learned a lot.

    Reply
  64. Desarrollos Web October 25th, 2009

    Thanks a LOT.

    Keep going on.

    Reply
  65. Alsen de Bak Eğlence Merkezi October 26th, 2009

    this very thank you..

    your web site very good..

    Reply
  66. Hery November 3rd, 2009

    nice man…

    Reply
  67. Web Design from Lyons Solutions December 19th, 2009

    Now a Days I would only go for CSS as opposed to Table. Far better than table, SEO friendly as wel.

    Reply
  68. Syed January 8th, 2010

    It’s very useful….

    Thanks a lot….

    Reply
  69. koneko January 9th, 2010

    thank you verymuch! i use Topstyle software for css design, it’s very useful. Let’s try it for your work and happy.
    download link:http://rapidshare.com/files/332260518/NewsGator_TopStyle_Pro_3.5.rar

    Reply
  70. Ben Stokes January 9th, 2010

    Great beginner guide to CSS – great stuff

    Reply
  71. Mobilcin, Mobil Ödeme Sistemi. January 9th, 2010

    this is thank you.

    your web site very good and your web site professional..

    Reply
  72. BEBEN January 16th, 2010

    damn…i am to late to visit here…
    grrrr!!!! nice article….

    Reply
  73. Abin February 4th, 2010

    This really is a, the discussion is very interesting and very educational, thank you for the learning, which helps me in knowing more about css

    Reply

Trackbacks

  1. 20 Useful CSS Tips For Beginners | World Boxx
  2. links for 2009-03-16 « Minesa IT
  3. 20 Useful CSS Tips For Beginners | six03
  4. socialwebcms.com
  5. links for 2009-03-16 on studiowhiz.com
  6. Daily Links | AndySowards.com :: Professional Web Design, Development, Programming, Hacks, Downloads, Math and being a Web 2.0 Hipster?
  7. abcphp.com
  8. 20 Useful CSS Tips For Beginners
  9. links for 2009-03-16 | RationaLogic
  10. Online Tips For Tech User » 20 Useful CSS Tips For Beginners
  11. Tuesday afternoon link serving [17th Mar '09] | Abhijat Saraswat
  12. Tuesday, March 17, 2009 | shiner.clay
  13. 20个适合于初学者的CSS技巧 | 网络2.0新闻
  14. More on Web and Grid Based Design - Chicken Doughnut
  15. Tus noticias, tus historias, tu decides - AnuiKi.com
  16. enhance your css | devexp
  17. 20 Tips on CSS for Beginners
  18. 20 de los “Tips” CSS más importantes | - DAM - Zona de estudios
  19. FTW Friday - 20 March 2009 | Border7 Studios
  20. A n00b g33k blog - g33k links (weekly)
  21. 跃读09003 | Plidezus'sky
  22. BlogIP :: Porady CSS dla początkujących
  23. 【译稿】20则实用的CSS小贴士 | 插座儿
  24.   20 użytecznych tricków CSS dla początkujących by mELON.pl
  25.   100 darmowych aplikacji dla Maca (część 1) by mELON.pl
  26. Punto Delta » Blog Archive » 20 Consejos CSS para principiantes
  27. 20 Tips de CSS para principiantes - Guiabreve
  28. Download Free Ebooks » 10+ Free CSS Ebooks
  29. 20 Kullanışlı Css Tekniği | Wordpress, JavaScript, CSS, Photoshop, Flash, Teknoloji, Google Adsense, Google Pagerank, Internet, SEO, Tasarım, Spor
  30. D-SYRO » Tutoriales de CSS
  31. FreeDownloadSecrets.com » Blog Archive » 40+ Must-See Resources And Inspirational Collections For Designers To Discover The Best Of The Web In March
  32. 20 Useful CSS Tips For Beginners | WaterG's Blog
  33. 20 полезных советов по CSS для начинающих верстальщиков | Вебмастеру пос
  34. 40+ Must-See Resources And Inspirational Collections For Designers To Discover The Best Of The Web | soccermania
  35. Manda’s Weekly Favorites #3 | Creative Opera: Design Advice and Creative Inspiration
  36. CSS Tips « Google Blogs and Wallpapers
  37. 84 Amazingly Useful CSS Tips & Resources | Hi, I'm Grace Smith
  38. 84个CSS教程,老外的。 - Booto’Blog
  39. 84 Useful CSS Tips & Resources | Monty Tuts - Your Ultimate Web Design Resource
  40. 15 Best of Web Resources in March 2009 – An Inspirational Post
  41. 網站製作學習誌 » [Web] 連結分享
  42. 20 tips útiles para principiantes en CSS « RobertDice.com
  43. The Great Geek Manual » Link Round-Up: April 28, 2009
  44. 50+CSS实用技巧和资源汇总 | 博译论 | 分享网络热门与新知 关注网络应用与营销
  45. Usefull links for CSS Programmers | Cogzidel Templates Blog
  46. 200+ anvndbara CSS tips, tutorials, verktyg och resurser | Webbrelaterat
  47. CSS Tips « Jellyhaus Blog
  48. 84 recursos y consejos sobre CSS « GoVisual
  49. Social Media Saturday 5/16 | Dallas McLaughlin
  50. Tagz | "20 Useful CSS Tips For Beginners | How-To" | Comments
  51. In 7 Schritten zu einem guten Blogredesign! tipps, tutorial, wordpress, xhtml, css, gestaltung, blogdesign | daswebdesignblog.de :: Artikel, Tutorials, Freebies und Interviews
  52. 20 Useful CSS Tips For Beginners | PLUS & PLAY . COM
  53. 부침개 블로그 » Blog Archive » 객체지향CSS가 무엇인고…?
  54. 10+ Free CSS Ebooks | DownRSS.com
  55. cssOrigins.com » Blog Archive » 84 Amazingly Useful CSS Tips & Resources | Grace Smith
  56. 20 Useful CSS Tips For Beginners | VNAMEDIA Sharing Center
  57. 84 Amazingly Useful CSS Tips & Resources « Knowledge Articles
  58. Week Three « Hypermedia 2009
  59. CSS Tips For Beginners | My Tech way
  60. 60+ Links to Help You Learn CSS Web Design | Web Hosting Blog | Lunarpages Lunartics
  61. 60+ Links to Help You Learn CSS Web Design « Web Design Blog
  62. JaredLewandowski.com » Blog Archive » Writing Good CSS
  63. 20 Useful CSS Tips For Beginners | Program resources
  64. Chilesabe » 84 tips CSS y Recursos
  65. enhance your css – kennethvr
  66. Dream of space » 84个CSS教程,老外的。
  67. A Comprehensive CSS Development Guide For Beginners & Experts « deCode10 – trends, technologies & more …
  68. বাংলা টিউটরিয়াল|বাংলা ভাষায় বিশ্বের প্রথম টিউট
  69. TG Developer » 47 CSS Tips & Tricks To Take Your Site To The Next Level
  70. 47 CSS Tips & Tricks To Take Your Site To The Next Level | CSS | instantShift
  71. Week Three « Digital Interactive Design 2010

Leave a reply