SitePoint Sponsor

User Tag List

Results 1 to 10 of 10

Thread: Why Use CSS?

  1. #1
    Former Staff Member silver trophy Adam P.'s Avatar
    Join Date
    Apr 2001
    Location
    San Francisco
    Posts
    3,288
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Why Use CSS?

    I always see people in forums saying "replace your <font> tags with CSS". What's the big deal with CSS besides the fact that it is easier to change a bunch of groups of text on different pages??

    I mean, I have a small personal page (only like 4 pages) and someone told me to use CSS.

    I was like "why"?? It would hardly be "more" convenient with such a small page.
    SPF Mentor/Advisor 2001-2003
    SPF Designer of the Year 2002
    SPF Graphic Designer of the Year 2003
    AdamPolselli.com

  2. #2
    Bimbo With A Brain! silver trophy Saz's Avatar
    Join Date
    Mar 2001
    Location
    Kent, United Kingdom
    Posts
    5,275
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    But what if your site expands?

    And then what if you decide you want to use a different font, or change the bg image, or change the colour scheme entirely meaning you have to alter font colours, hyperlink colours et al.

    Trust me...I know. I recently converted my site to use an external style sheet. It took hours to remove all the internal style settings.........and my site's not that big!

    You'll find all these issues and more under this thread....

    http://www.sitepointforums.com/showt...threadid=25277
    Saz: Naturally Blonde, Naturally Dizzy!
    No longer Editor of the Community Crier.

    Don't mind me, I'm having a BLONDE moment!

  3. #3
    Sports Publisher mjames's Avatar
    Join Date
    Jan 2000
    Location
    Charlotte, NC
    Posts
    5,891
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    CSS is a HUGE bandwidth saver! Imagine how much you could save with using CSS to define font faces and sizes on your page. You wouldn't have to put <font size="4" color="#0066FF" face="Tahoma, Arial, Helvetica, sans-serif">, per say, a million gazillion times on every page.

  4. #4
    pg for mild peril cow's Avatar
    Join Date
    Mar 2000
    Location
    nevada, usa
    Posts
    636
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you're right. it wouldn't be that useful for a personal page of 4 pages or so.

    with css you can get the entire site with the same look and feel (style) and you can change that style by just changing a few lines in one file.

    the advantages aren't realized until you have a site with hundreds of pages scattered through many directories all needing to look the same. would you rather open 100 files to change just the font color or open just one file?

    css also allows you to write tighter, faster code. rather than writing <font size="1" color="#FF00FF" face="Arial, sans-serif"> you can replace it with <div class="blah">. when you have a large page with different colors, sized text, paragraphs, etc...you can save a few bytes on file size (yeah, i know this advantage is negligible ).

  5. #5
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Why?

    1) Easier to update.

    Say you are using Times New Roman for your typeface on your website. What if you wanted to change the font to Verdana? Without CSS you would have to open every page in your site, find every instance of a Times New Roman definition and change them to Verdana.

    With CSS, you simply open your stylesheet and change Times New Roman to Verdana.

    2) Newer technology gives the designer an improved and expanded toolbox.

    Attributes such as min-width, max-height, @import allow the designer to create pages with much greater flexibility as well as allowing those pages to be compatible with a greater range of devices such as Cell Phones, PDA's and devices not yet invented.

    3) Gives the designer a reason to learn a knew and exciting technology.

    For some designers this would be reason enough to learn CSS (stylesheets).

    I'll be honest, for a 4 page personal website, CSS might be overkill for you. However, if you plan on learning how to design websites then learn CSS now while you can. In a year or so you won't be ABLE to design without CSS.

    I would also refer you to this thread that basically asked the same question that you asked:
    http://www.sitepointforums.com/showt...threadid=25277
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  6. #6
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by cow
    css also allows you to write tighter, faster code. rather than writing <font size="1" color="#FF00FF" face="Arial, sans-serif"> you can replace it with <div class="blah">. when you have a large page with different colors, sized text, paragraphs, etc...you can save a few bytes on file size (yeah, i know this advantage is negligible ).
    The advantage is NOT negligible or they would not be touting CSS as a way to reduce file size. If you save a half a k (.5k) 10 times on a page, that's 5k. That just saved a 33.6 user 1 second of download time. When you do that for all 100 of your pages and the average user goes to 10 pages ,you not only saved your user 10 seconds of download time, you saved your server 10k of bandwidth. What if you had 10,000 users that do the same thing as the first user?

    You just saved your server 50 megs of bandwidth. It all adds up people. It's just a matter of being proactive.

    Again, CSS might NOT be for you on a site with 4 pages. But it's still fun to learn and use. That in itself is a good reason to learn it.
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  7. #7
    pg for mild peril cow's Avatar
    Join Date
    Mar 2000
    Location
    nevada, usa
    Posts
    636
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i meant negligible on a 4 page site...because i was thinking you might be able to save .1k a few times on each page amounting to less than a second savings in download time.

  8. #8
    Former Staff Member silver trophy Adam P.'s Avatar
    Join Date
    Apr 2001
    Location
    San Francisco
    Posts
    3,288
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks for all the replies guys! i understand a lot more now
    SPF Mentor/Advisor 2001-2003
    SPF Designer of the Year 2002
    SPF Graphic Designer of the Year 2003
    AdamPolselli.com

  9. #9
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by cow
    i meant negligible on a 4 page site...because i was thinking you might be able to save .1k a few times on each page amounting to less than a second savings in download time.
    Got it...
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  10. #10
    will code HTML for food Michel V's Avatar
    Join Date
    Sep 2000
    Location
    Corsica
    Posts
    552
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    CSS can also come in handy with user-preference determined colors.
    For example, on my site there are 6 "skins". They are just 6 different CSS files applied to the very same HTML code. But I tend to be a bit crazy on CSS, I sometimes create a new CSS file just for one page
    So even for a 4 pages site it's very efficient when you get used to using it regularly

    Also, CSS-positionning is a treasure. No more 10k worth of TABLE tags...
    [blogger: zengun] [blogware contributor: wordpress]


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •