SitePoint Sponsor

User Tag List

Results 1 to 14 of 14

Thread: CSS only?

  1. #1
    SitePoint Wizard
    Join Date
    Jan 2001
    Location
    Grand Rapids, MI
    Posts
    1,284
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question CSS only?

    I was just wondering if I should just design my entire site for CSS or do CSS and HTML. Like have the people with compatable browsers see the CSS, but the ones without will still see the same thing only HTML. So can I use the CSS and then do the same thing with standard HTMl or would this be a waste? Should I just then use HTML only?

  2. #2
    SitePoint Wizard silver trophy Jeremy W.'s Avatar
    Join Date
    Jun 2001
    Location
    Toronto, Canada
    Posts
    9,121
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Maintaining 2 sets of the same information is NEVER worth it
    SVP Marketing, SoCast SRM
    Personal blog: Strategerize
    Twitter: @jeremywright

  3. #3
    You talkin to me? Anarchos's Avatar
    Join Date
    Oct 2000
    Location
    Austin, TX
    Posts
    1,438
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I agree with Jeremy; what's wrong with using html anyway? It works fine.
    ck :: bringing chris to the masses.

  4. #4
    SitePoint Wizard edshuck's Avatar
    Join Date
    Jul 2000
    Posts
    1,200
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i am not so sure it is a bad idea.

    maybe it is just not a good idea to have both, but without options.

    the real key is "what about your visitors"?

    i read an article where the writer was moving to CSS on the company intranet. in that case, the viewers are captive and can be served as dictated.

    but the guy was really concerned about the users visiting from home.

    for the most part it is ok. somewhe re here at SP is a study about the brouser % for each type.

    i am going to try it. i want to see if i can get through with one template (or whatever it is called) and a bunch of includes from php.

    for the current page, i use essentially a blank page with just includes. what it will mean is moving the format elements from the included elements to the template. then use a function for each of the pages.

    oh, well.

    it should be fun.

    peace

    ed

  5. #5
    SitePoint Wizard
    Join Date
    Jan 2001
    Location
    Grand Rapids, MI
    Posts
    1,284
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok, thanks for all your help. But most styles aren't supported in Netscape, so how does SitePoint make the site look perfect in both? Is it using CSS and HTML?

  6. #6
    You talkin to me? Anarchos's Avatar
    Join Date
    Oct 2000
    Location
    Austin, TX
    Posts
    1,438
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    View the source....
    ck :: bringing chris to the masses.

  7. #7
    <C²: web standards /> cybercodeur's Avatar
    Join Date
    Dec 2001
    Location
    Montréal
    Posts
    729
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by Ben
    Ok, thanks for all your help. But most styles aren't supported in Netscape, so how does SitePoint make the site look perfect in both? Is it using CSS and HTML?
    SitePoint is using CSS in a way that is cross browser, backwards and forwards compatible. It basically means that the stuff they're using now works in v4+ browsers, but as time goes by it will become less and less viable.

    I am in the process of doing an all CSS site for myself. It meant I had to take the decision of not supporting non-standard compliant browsers (ie4- and Ns4- ).

    It is a forwards compatible solution, but one that can be hard to take for some people.

    If you want to please everyone, then browser detect your visitors and redirect them to specific stylesheets that will satisfy their browser needs.

    Or you can keep on coding the way NS4 wants it and everyone will see your code. But by doing so, you have to be aware of two things.

    First, you will not be able to fully grasp and use the power of new technologies such as CSS.

    Second, you will put your hard work on working methods that will only keep being unsupported by standards and therefore meant to be unsupported eventually.

    In my opinion, if you want to please everybody, you'll end up pleasing no one. If all else fails, CSS each browser. But that's a lot of extra work.
    Denis Boudreau <C²/> - Web Standards & Accessibility
    [+] ICQ number: 115649885 || Email: denis@cybercodeur.net
    [+] Daily Weblog on Web standards and accessibility : CYBERcodeur.net

  8. #8
    SitePoint Zealot Drew630's Avatar
    Join Date
    Nov 2001
    Location
    Maryland
    Posts
    175
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Cyber is right, if you want to use CSS the best way is to make it cross-browser compatible. Unfortunately, I don't have my DHTML book here or I would tell you how

    At any rate, to do both, is tough and very time consuming. My suggestion is to not do both, since most people are running browsers that are compatible with CSS, wither Netscape or IE. The select few who do not get to see the CSS will still see the HTML, it will just be boring and ugly. Just like all the other sites they visit, since their browser really sucks! This might give those users an idea to upgrade...

    Before I rant, I'll end. I assume that you understnad the signifigance and the gain from using CSS if you are posting here....

    Drew
    ~Drew

    There Is No Greater Joy Than Soaring High On The Wings Of Your Dreams, Except Maybe The Joy Of Watching A Dreamer Who Has Nowhere To Land But In The Ocean Of Reality.

  9. #9
    <C²: web standards /> cybercodeur's Avatar
    Join Date
    Dec 2001
    Location
    Montréal
    Posts
    729
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Browser dtecting your CSS is fairly simple, actually. Here is the simplest exmaple, where I detect if its NS or IE and direct to different CSS. THe whole thing goes in the head of your document, or an external js file.

    This first section serves to detect the browser:

    function lib_bwcheck(){
    this.ver=navigator.appVersion
    this.dom=document.getElementById?1:0
    this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
    this.ie4=(document.all && !this.dom)?1:0;
    this.ie=this.ie4||this.ie5
    this.ns=this.ns4||this.ns5
    this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;
    this.ns4=(document.layers && !this.dom)?1:0;
    this.ns=this.ns4||this.ns5
    this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5)
    return this
    }

    var bw = new lib_bwcheck()


    And this part assigns the stylesheet to the browser through a document.write:

    function css_check () {
    if (bw.ie){
    document.write("<link rel='stylesheet' type='text/css' href='css/styles.css' />")
    }
    if (bw.ns) {
    document.write("<link rel='stylesheet' type='text/css' href='css/styles2.css' />")
    }
    }


    Hope this helps. You could change it to specify different browser version as easily. Instaed of calling (bw.ie) for example, you could call (bw.ie4) and it would only adress that browser version.
    Denis Boudreau <C²/> - Web Standards & Accessibility
    [+] ICQ number: 115649885 || Email: denis@cybercodeur.net
    [+] Daily Weblog on Web standards and accessibility : CYBERcodeur.net

  10. #10
    SitePoint Wizard
    Join Date
    Jan 2001
    Location
    Grand Rapids, MI
    Posts
    1,284
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Cyber, thanks for that code. I'll look into using to different forms of the CSS. But do you know any good CSS and DHTMl books? I was looking at one once but I can't remember. I think the motto was something like "...for professionals by professionals". Thats really the only book I ever took alook at for DHTML. If you guys know anything please let me know. Thanks for all your help.

  11. #11
    <C²: web standards /> cybercodeur's Avatar
    Join Date
    Dec 2001
    Location
    Montréal
    Posts
    729
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I only preach by O'Reilly.

    You can get the Definitive Guide for CSS by Eric Meyer or the DHTML book by some dude whose name I forgot.

    If you can't shell out that amount, then go with Visual Quickstart guides. It's an excellent reference on both CSS and DHTML by Jason Cranford Teague. It's about half the price and still pretty good.
    Denis Boudreau <C²/> - Web Standards & Accessibility
    [+] ICQ number: 115649885 || Email: denis@cybercodeur.net
    [+] Daily Weblog on Web standards and accessibility : CYBERcodeur.net

  12. #12
    SitePoint Wizard Ian Glass's Avatar
    Join Date
    Oct 2001
    Location
    Beyond yonder
    Posts
    2,384
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'd go with straight CSS, myself (of course I would say that, wouldn't I? ;-).

    Using depreciated tags with HTML tricks really isn't 'compatible' because it hurts your pages ability to be viewed by other browsers and will eventually be ignored in the future. Compatibility isn't about getting your pages to look exactly the same in the last round of browser voiles; it's about getting your pages to convey it's content and information (note: not the design) regardless of which browser your visitor uses.

    Right now the market is completely dominated by browsers that support the CSS standards well enough to make a full fledge CSS page. The version four browsers have been rapidly declining in market share. And now, by the time a new site begins to become popular enough to weren't the use of browser hacks, I doubt NS4 would be much of an issue any more.

    ~~Just My 2¢

  13. #13
    <C²: web standards /> cybercodeur's Avatar
    Join Date
    Dec 2001
    Location
    Montréal
    Posts
    729
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by Ian Glass
    And now, by the time a new site begins to become popular enough to weren't the use of browser hacks, I doubt NS4 would be much of an issue any more.
    One hell of a good argument!
    Denis Boudreau <C²/> - Web Standards & Accessibility
    [+] ICQ number: 115649885 || Email: denis@cybercodeur.net
    [+] Daily Weblog on Web standards and accessibility : CYBERcodeur.net

  14. #14
    SitePoint Wizard Ian Glass's Avatar
    Join Date
    Oct 2001
    Location
    Beyond yonder
    Posts
    2,384
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by cybercodeur
    One hell of a good argument!
    Thanks! :-)

    Anyone else have other arguments? I'm sure there are more than those just brought up here.

    ~~Ian


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
  •