Learning CSS do I need to know XHTML?

Discussion in 'Web Design and Development' started by andyjamesnelson, Aug 24, 2008.

  1. andyjamesnelson macrumors 6502

    Joined:
    Aug 24, 2003
    Location:
    Jacob's house
    #1
    Hey - I am currently learning CSS but I have to admit its the only web technology I have ever learnt!

    I cannot express how new at this I am.

    I am doing pretty well with CSS and I grasp it in concept pretty well so far.

    I'm wondering if I need to learn XHTML as well and if this well inform my knowledge of CSS.

    Also is CSS the leading standard in web coding now? Is there something I will need to learn?

    Thanks, Andy
     
  2. jaikob macrumors 6502

    jaikob

    Joined:
    Jul 1, 2008
    Location:
    Freeland, MI
    #2
    Wow, you learned CSS before XHTML?? I'm impressed. Yes you need to learn it, considering CSS is the way you are going to make XHTML act.

    CSS is pretty much standard.
     
  3. andyjamesnelson thread starter macrumors 6502

    Joined:
    Aug 24, 2003
    Location:
    Jacob's house
    #3
    Hey - ok well I haven't learnt CSS fully or anything...

    Ok but do I need to learn HTML before XHTML or does XHTML replace HTML?

    Andy
     
  4. epochblue macrumors 68000

    epochblue

    Joined:
    Aug 12, 2005
    Location:
    Nashville, TN
    #4
    XHTML and HTML are effectively the same thing. XHTML (short for eXtensible HyperText Markup Language) is basically HTML with stricter (XML) rules for formatting (all lowercase letters, addition of self-closing tags, etc).

    For a quick primer on the differences, you could check out this article.

    Truthfully, unless you have a compelling reason to serve up XHTML instead of HTML, I'd just learn HTML 4.01. Anything you learn there will carryover to XHTML if you decide that makes more sense.

    For a decent rundown of what the differences are to browsers, you might want to read this article by the WebKit team.
     
  5. andyjamesnelson thread starter macrumors 6502

    Joined:
    Aug 24, 2003
    Location:
    Jacob's house
    #5
    Thanks for the reply,

    Does anyone have some good suggestions for the fastest way I can learn HTML? / and CSS for that matter.

    Also I should be learning HTML 4.1 yes?

    Andy
     
  6. ULEE macrumors member

    Joined:
    Feb 27, 2008
    #6
    For CSS I think Lyndia.com CSS Site Design is pretty good and easy to understand. Plus its completely based on videos which I prefer over books/ebooks (for learning a programming language). I think they also have a XHTML tutorial which I havent used but its definitly worth checking out their stuff.
     
  7. 66217 Guest

    Joined:
    Jan 30, 2006
    #7
    Check this out: http://www.sitepoint.com/books/html1/

    They offer a 4 Chapters free preview. Those 4 chapter were enough for me to get started. They explain the most basic step to learn HTML in a very detailed and practical way.

    I really recommend reading those 4 Chapters.
     
  8. Edfrommars macrumors newbie

    Joined:
    Jun 10, 2008
    Location:
    Ohio, USA
    #8
    epochblue is right but I disagree with you learning HTML 4. If you learn XHTML and use DOCTYPEs properly, you will have a lot less issues across browsers.
     
  9. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #9
    Out of curiosity, what's your basis for that statement?
     
  10. epochblue macrumors 68000

    epochblue

    Joined:
    Aug 12, 2005
    Location:
    Nashville, TN
    #10
    Out of habit, I typically use XHTML myself, but in the past I've read some good arguments for using HTML over XHTML that did cause me to stop and think.

    I could be swayed that XHTML is a better thing to learn on due to the restrictions it provides (restrictions I think lead to cleaner markup overall).
     
  11. SrWebDeveloper macrumors 68000

    SrWebDeveloper

    Joined:
    Dec 7, 2007
    Location:
    Alexandria, VA, USA
    #11
    There are always situations where a legacy technique such as HTML 4.1 works better than the modern standard, XHTML which comes in two general flavors - transitional and strict.

    I say learn basic HTML and then advance to XHTML 1.0 transitional which involves CSS with a looser syntax for XHTML and is common these days for novices and gurus alike. Use the W3C Schools web site to take basic tutorials on all the above to educate yoursef, examine other people's code whenever possible, and adjust Dreamweaver's settings to default a new page to any of these DOC Types and start coding and learnin'.

    You'll know you're doing it right when your code validates properly, and remember the validator looks at your DOC Type you've selected. Correct all errors and heed all warnings, even if you have to re-take the tutorial, look things up in Google, copy code from someone else, etc. That's how I learned.

    XHTML strict is a modern best practice now according to the W3C, I do not suggest this until you've mastered the others, and is a professional implementation intended to separate presentation from style -- 100%. It is by no means the best DOC Type for all situations, but transitional will be phased out in years to come so the pro's out there should learn strict syntax and keep up with the latest CSS as well. Not necessary for anyone out there doing a simple iWeb implementation.

    -jim
     
  12. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #12
    Do you happen to have a reference for that? I don't think I've ever seen it phrased that strongly. I'm a XHTML 1.0 Strict guy myself, because I like the XML aspect a lot. With HTML 5 on the horizon and XHTML 2 being much further behind I'm not as big on XHTML as I use to be. I use to think XHTML was going to be taking HTML's place, but from what I've seen we're just going to have a forked path now for some years (unfortunately).

    I'm not saying people shouldn't use XHTML. I think people should at least strive for X/HTML Strict, even if they don't start there. There's not a big difference between the two strict DOCTYPEs. That's my take on it. I follow the X/HTML groups and their discussions (and bickering) so consider myself decently knowledgeable on this topic. I wish we just had HTML or XHTML to make it easier for people to learn, for programming languages to parse, and for WYSIWYG web page editors to deal with all of this.
     
  13. andyjamesnelson thread starter macrumors 6502

    Joined:
    Aug 24, 2003
    Location:
    Jacob's house
    #13
    Some of this is going over my head for sure but thats not a problem.

    One question I would like to ask people is if they know a good video tutorial thats aimed at someone who's learning html with a view to using css.

    All the html tutorials I seen mainly concentrate and waste time in so much as they focus alot of formating within html and that is something I cannot see myself doing much as I will use css.

    andy
     
  14. MegaMan1311 macrumors regular

    Joined:
    Jun 30, 2007
    Location:
    USA
    #14
    Yes, you must learn (X)HTML to use CSS. Without (X)HTML, CSS is USELESS. CSS chagnes the position and appearance of (X)HTML, nothing more, nothing less.

    (X)HTML uses different tags to create different blocks, images, etc. on the page, and the CSS moves it and changes its appearance.

    XHTML is just a stricter version of HTML. Think of it this way. This could confuse, or help you, hopefully help.
    You have to write a letter. You can either write it or type it.
    Writing it is like HTML. It is messier, but you are much more free with your letters and the way you write your letters.
    Typing is like XHTML. It is much neater, but your letters are confined to the font you are using.

    Also, for a good XHTML guide, try w3schools.com.

    Here is my view on all of the XHTML vs HTML stuff.
    XHTML is better for getting browsers to work the same.
    HTML is better for being less strict, and having more tags and attributes.

    In my experience, XHTML sites tend to have cleaner code though...

    I prefer XHTML, as it is a good compromise between ease, form, and function.
     
  15. stndn, Aug 25, 2008
    Last edited by a moderator: Oct 23, 2012

    stndn macrumors member

    Joined:
    Oct 22, 2006
    Location:
    earth
    #15
    (This is the kind of thread that usually derails from simple CSS question to HTML vs XHTML, so get used to it :) )

    Regardless of all the issues on HTML vs XHTML you will need to learn how to write markup language (the 'ML' part of X/HTML) before the CSS you learn can be applied to use.
    (Btw, X/HTML and/or (X)HTML are common shorthands for HTML/XHTML)

    Actually, before you know how to format things with CSS, you'll have to learn how to format things within HTML. The reason is that you'll have to learn how things were done in the past, find the alternative using CSS, and then move there. Some of the CSS "codes" are actually derived from the HTML attributes. So, knowing how the HTML attributes control appearances may be helpful. Also, it might be helpful in cases where you find yourself stuck when changing CSS but the formatting stays, as sometimes there might be formatting leftovers in your X/HTML.

    (If it's over your head, that's fine. You'll get it eventually :) )


    As MegaMan1311 said, CSS is what's used to change the appearance of everything defined by X/HTML. So, without having something to change, you won't be able to experiment with the knowledge you just learned.

    The good news is, you can learn X/HTML without having to learn CSS. The bad thing about this (X/HTML only) is, if you were to change the appearance of everything you have built, you'll have to do it the crude way, and end up making your page less efficient.


    What's the fastest way to learn X/HTML? Practice, practice, and practice.

    I don't know of any video tutorial on this subject (used to learn from geocities and old textbooks), but books might be better because what you need to learn are the syntax and not how to type them.

    Start with a simple page. Think of a simple hobby of yours, and build a dedication page for it. Then, start adding things to it and before you know it, you'll be learning more than you initially planned to.


    With regards to XHTML vs HTML: I used to start with HTML, then moved on to XHTML and finally went back to HTML 4.01 STRICT. What's more important is actually making sure you use a strict version of either one, stick with it, validate against it, and make sure you follow the guide for either one carefully.

    If you feel like reading more about XHTML vs HTML, click here or here. Otherwise, skip CSS for now, start learning HTML or XHTML (pick one), then go back to CSS.


    -stndn.
     
  16. andyjamesnelson thread starter macrumors 6502

    Joined:
    Aug 24, 2003
    Location:
    Jacob's house
    #16
    Thanks for all that. It looks like I need to learn some more html...

    I am sure it won't hurt me.

    Andy
     
  17. SrWebDeveloper macrumors 68000

    SrWebDeveloper

    Joined:
    Dec 7, 2007
    Location:
    Alexandria, VA, USA
    #17
    @angelwatt

    Source

    Notice "Recommendation" is in upper case, that refers to specifications, developed by W3C working groups and that a specification is appropriate for use by the public. If you read the document on that page, the priority recommendation is XHTML 1.0, and of the 3 flavors listed on the page "strict" comes first, with the following notation:

    Hence a "best practice" - a widely accepted interpretation of the W3C's suggestion to use XHTML 1.0 strict for cleanest markup. Do not confuse best practice with "only" or "absolutely works all the time" or even "you'll like it better". It's completely subjective. And as you and others noted, there are different standards being developed parallel to this. My comment focused on this working branch, not drafts.

    -jim
     
  18. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #18
    That makes sense with the way they define Recommendation, though it is somewhat misleading. Thanks for the link. I am a little worried XHTML2 will fork quite a bit farther from HTML5 than what we currently have with XHTML1 and HTML4.01. It'll be interesting to see how the browsers handle it all as well.
     
  19. andyjamesnelson thread starter macrumors 6502

    Joined:
    Aug 24, 2003
    Location:
    Jacob's house
    #19
    just to add another question and to join in with the html or xhtml discussion that my thread began :)...

    It would seem that I will be working with mobile phone content - this means I need to know and use xhtml yes? As they only understand this version.

    Andy
     
  20. SrWebDeveloper macrumors 68000

    SrWebDeveloper

    Joined:
    Dec 7, 2007
    Location:
    Alexandria, VA, USA
    #20
    I cannot account for your specific situation, but generally speaking for mobile phone content professional developers work with WAP/WML. WAP refers Wireless Application Protocol, an application layer set of standards which enables access to the Internet via HTTP for mobile phones and PDA's. WML refers to the Wireless Markup Language, a proprietary language intended for WAP devices (browsers in phones/PDA's with tiny screens, card ID's are involved, etc).

    An excellent tutorial on WAP/XML can be found here (W3Schools, as usual).

    All the languages we've discussed are similar in basic structure, most are based on XML structures which have been refined and standardized for specific needs. They all have unique DOC TYPES, tags and formatting standards and are well documented. Very low learning curves here.

    -jim
     
  21. yagran macrumors 6502a

    Joined:
    Jan 8, 2007
    Location:
    Brighton, East Sussex, UK
    #21
    the best way i found to learn was just to keep making websites. When you realize you don't know how to do something, go look it up.

    worked ok for me, although you need to watch out for bad habits...
     

Share This Page