HTML vs. XHTML vs. CSS

June 2, 2008 at 9:37 pm (Uncategorized) ()

I first looked at a website called W3 Schools which is a website I sometimes go to when I am needing some help with code or just trying to learn something new. They actually had an article called XHTML vs. HTML which explains that XHTML is actually very similar to the HTML 4.01 standard. If you are already planning on using the HTML 4.01 standard for your coding then there are only a few changes that need to be made to your code. The main differences in coding with XHTML are: your elements have to be properly nested, everything must be in lowercase, all elements must be closed (i.e. <a href =”www.wordpress.com”>wordpress</a>) and documents must have one root element, which I think means that they have to be within a parent element, typically it would be something like “<html>… entire document …</html>” where everything in between would be a sub-element. There are some additional differences which are documented by W3.org in this article.

Cascading Style Sheets, or CSS, was developed to help clean up HTML code. Previous to CSS all visual formatting was written in the same markup language as the content which caused problems with messy code. CSS was developed to take over the layout role and separatethe code for content from the code for the page style. “Cascading” refers to a calculation of priorities by predefined rules so that the end result, the web page layout the viewer sees, is predictablefrom one browser to the next. CSS coding can be included in the <head> elements of HTML document itself, if it only refers to the style of that specific page, or in a separate CSSfile which is referenced in the HTML code, allowing the same style to be used for multiple pages. CSSZengardenshows examples of what can be done using CSS. By clicking on different stylings on the left side of the page you can change the layout of the page while the content remains the same.

CSS and other web standards are important for the usability and compatibility of the web. Without out web standards we would still only be able to view certain pages correctly using a certain browser. Webstandards.org is a coalition that ensure web standards are implemented globally. Using tests like the Acid3 test to ensure browser interoperability and working with the major software companies to encourage the use of web standards in their software releases. As future web designers we need to stay in-tune with these standards to ensure the maximum compatibilty of our web design projects.

 

6 Comments

  1. Lindsey Norman said,

    It seems like there are a lot of subtle differences between XHTML and HTML. I am definitely going to have to look more into what these differences entail. I’m starting to really see why it’s so important to stay on top of new standards in web design. If you stop paying attention for a minute, you’ll be obsolete.

  2. danpro1 said,

    I did some research on your question on my blog, although I couldnt find any real statistic, it seems as though the old school developers are adament about switching over to XHTML. Old habits are hard to break I guess.

    I had a great time on the 3 schools web site. I really learned alot and was able to practice what they were teaching me. I have saved it to my favorites.

  3. nicosilva said,

    Thank goodness for web standards. Too bad browsers are taking so long to catch up. I’m still annoyed that all browsers cannot render all pages correctly. You’d think with all the buzz about web standards, they’d step up their performance in this field, right?

    Lindsey, from what I’ve seen, it’s really a syntax issue. Everything must be clean, closed, and lower space to cut it with XHTML. I’m probably skipping over some technical details describing it like that, but oh well.

  4. jlphannah said,

    Wow you were right. We did use a lot of the same resources. Great minds think alike I suppose. I mainly gleaned over the basic principles of HTML, XHTML, CSS and web standards.

    Your statement, “CSS was developed to take over the layout role and separate the code for content from the code for the page style.”, definitely helped to simply its meaning for me.

    I checked out 3schools based on Danny’s recommendation and it seems like a good tutorial site. The Basic Section will definitely help as a refresher to HTML.

  5. usernumber said,

    I bookmarked that first link you posted.

    Your post helped me tremendously. Thank you.

  6. rmspencer said,

    It is great that we have the wd3 standards but with the way everything is changing so fast i just cant wait till it gets to a point to where it slows down and becomes easier to make things look nice and display. lol and possibly easier to write. but then again when things so called “become easier” they seem to get really hard.

Post a Comment