Jump to content

  • Log in with Facebook Log in with Twitter Log In with Google      Sign In   
  • Create Account

Subscribe to HRA Now!

 



Are you a Google Analytics enthusiast?

Share and download Custom Google Analytics Reports, dashboards and advanced segments--for FREE! 

 



 

 www.CustomReportSharing.com 

From the folks who brought you High Rankings!


Sponsored Content

 

 
 

Photo
- - - - -

XHTML and CSS


  • Please log in to reply
72 replies to this topic

#1 dbmasters

dbmasters

    HR 4

  • Active Members
  • PipPipPipPip
  • 220 posts

Posted 04 February 2004 - 09:12 AM

If you are interested in writing valid code, start looking beyond HTML and start using XHTML. Since I have been doing that my cross-browser probs and issues of that nature have seriously subsided. I try to code XHTML strict...but usually settle at transitional because not all browser deal with XHTML strict that well yet, tho the major ones do.

#2 TopDog

TopDog

    HR 3

  • Active Members
  • PipPipPip
  • 59 posts
  • Location:Mesa, AZ

Posted 04 February 2004 - 09:36 AM

I wholeheartedly agree with XHTML, and also use transitional XHTML. A lot of people don't know it, but there are no newer versions of HTML planned. XHTML has replaced HTML, but is not widely used because of the CSS compatibility issues with older browsers, particularly NS 4. If your audience does not use older browsers, XHTML is the way to go.

My newest site that just went up last month is all XHTML with a heavy dose of CSS. People like the design and report that it is extremely fast, even on a dial-up. :bubbly:

#3 dbmasters

dbmasters

    HR 4

  • Active Members
  • PipPipPipPip
  • 220 posts

Posted 04 February 2004 - 09:58 AM

I gave up caring about anyone that uses NS4 over a year ago. Heck with 'em. Keep up or get out! :bubbly:

The trick with CSS is like Javascript, keep it in an external file cuz then it's globally editable and it caches which cuts down load times.

#4 Adrian

Adrian

    HR 2

  • Active Members
  • PipPip
  • 32 posts

Posted 04 February 2004 - 10:06 AM

Using validating code may not be terribly important as far as search engines are concerned (I can't see Google or someone finding 2 really similar sites and deciding to validate them to see which has been coded better....) but that doesn't mean its not worth doing.

Validating a page can help sort issues with it not displaying right in browsers in cases. In this area the DocType is pretty important, some browsers go into 'quirks' mode if one is not defined.

HTML4.01 or XHTML1.0 are the 2 you're most likely to use at the moment. XHTML is the newer spec, but HTML Strict is actually tighter on your coding than XHTML Transitional.

The main difference between the 2 is that some things that were deprecated in HTML are now completely out of XHTML, a few slight syntax difference (such as tags like <img> now have to be self terminated <img /> style). You're also encouraged to use CSS for a lot more in XHTML than you need to in HTML4.01.

To start with I'd suggest using HTML4.01 Transitional which TopDog posted, looks to be full and correct.

As mentioned, IE is VERY forgiving on the code side of things, others like NS (especially 6+) and Opera are a lot stricter on what they need to make it work. Running it through a validator can sort a lot of cross browser issues.

#5 Adrian

Adrian

    HR 2

  • Active Members
  • PipPip
  • 32 posts

Posted 04 February 2004 - 10:12 AM

XHTML has replaced HTML, but is not widely used because of the CSS compatibility issues with older browsers, particularly NS 4.


Its not a replacement for HTML, using XHTML is no more correct in a sense than HTML. Well done XHTML code does tend to be more compact and simpler to go back to.

Its not the actual XHTML that browsers have problems, but some of the CSS that is used for more of the styling. NS4 will handle some basic stuff but is pretty appaling at it overall.

As I mentioned in the last post, HTML4.01 Strict is really stricter on your syntax than XHTML1.0 Transitional is. If you can get through HTML4.01 Transitional ok, then try HTML4.01 Strict and see how you do. Sometimes you can't be 100% compliant, but that just takes a bit of knowledge and experience to know how far to go, bit of a compromise between browser compatibility, target audience, W3C Standards and development time involved.

#6 TopDog

TopDog

    HR 3

  • Active Members
  • PipPipPip
  • 59 posts
  • Location:Mesa, AZ

Posted 04 February 2004 - 10:16 AM

For most sites, I too have given up caring about NS 4. But I still use it for testing, just so I know what cavemen see when they view my web sites.

The one exception is e-commerce sites. They tend to attract a wider variety of users, including a surprising number of NS 4 users. The percentage is still extremely small, but if you don't want to turn away potential buyers, you limit your options for the use of some CSS designs.

You are absolutely correct that an external style sheet is the only way to go. I can tweak colors, menu design and other elements for an entire site just by changing a single style sheet. It is very efficient.

Craig :tooth:

#7 Scottie

Scottie

    Psycho Mom

  • Admin
  • 6,293 posts
  • Location:Columbia, SC

Posted 04 February 2004 - 10:35 AM

OK- who's got the details on XHTML?

Point us at a tutorial you recommend or other informational resource. I'm getting ready to start a site redesign so it's a good time to learn. ;)

#8 Adrian

Adrian

    HR 2

  • Active Members
  • PipPip
  • 32 posts

Posted 04 February 2004 - 10:45 AM

OOh, Scottie, Scottie, Scottie, I think I have just the thing :P

http://www.camaban.co.uk/xing.php is more of my take on the differences between the 2. The 2 links at the end are pretty good as well, especially the WDVL article.

Then its just a case of learning more advanced CSS and finding where your preferred compromise between the standards and browser compliance is. As has been mentioned, some browsers have pretty poor support for CSS so its going to partly depend on your target audience. NS4 can be served a simplified, less styled style sheet, so theres a bit fo a work around there. IE6 is then the main problem of the modern browsers.

Not sure how up to speed you are on CSS but I've got a few fairly basic CSS tutorials on my site. And theres a good list of CSS resources in the *cough*Cre8asite Resource Directory*cough* ;)

#9 Scottie

Scottie

    Psycho Mom

  • Admin
  • 6,293 posts
  • Location:Columbia, SC

Posted 04 February 2004 - 10:48 AM

LOL!

I figured you would have some good resources Adrian! Thanks! ;)

#10 dbmasters

dbmasters

    HR 4

  • Active Members
  • PipPipPipPip
  • 220 posts

Posted 04 February 2004 - 10:57 AM

there are also plenty of good cheap books at the local outlet malls. XHTML has been around long enough where some of those books have made it down to outlet stores.

#11 TopDog

TopDog

    HR 3

  • Active Members
  • PipPipPip
  • 59 posts
  • Location:Mesa, AZ

Posted 04 February 2004 - 11:01 AM

Hi Scottie

I don't know how much you currently know about XHTML, but I started with the simple W3 Schools XHTML tutorial at W3 Schools. You can do a search for "XHTML tutorials" and you'll find a ton of good information.

With XHTML, if you really take it to heart and adhere to the standards you'll gain a lot of efficiencies, which speed up page delivery and rendering. Plus, you will likely learn a lot more about CSS in the process. XHTML relies heavily on CSS.

Whether or not you want to call XHTML a replacement for HTML is, I suppose, a matter of opinion. There aren't very many sites using XHTML, primarily because of the CSS compatibility issues with older browsers, plus most WYSIWYG tools have not yet caught up with XHTML standards.

From what I have read, there are no plans to set an HTML 4.02 or HTML 5.0 standard. The current standard is XHTML, and the plan is to eventually push all developers to this new standard. Currently, it is more of an alternative that is just starting to catch on. I think HTML will be around for a long time.

I recommend that you stick to XHTML version 1.0 for now. There are newer versions, but in my opinion, too many HTML tags have been depreciated.

Craig ;)

#12 Adrian

Adrian

    HR 2

  • Active Members
  • PipPip
  • 32 posts

Posted 04 February 2004 - 11:11 AM

One of the big issues with take up of standards based XHTML style pages, is that it pushes people towards not using tables for layout. Something which is pretty ingrained into many designeres and requires a fair bit of unlearning and realearning how CSS Positoning works. Its in CSSp that more of the cross browser problems come out as well.

People like Jeffrey Zeldman (one of the big names in web standards) tend to recommend being realistic with it. Often he will use a kind of hybrid layout, some simplistic tables for overall structure and then some more simple CSS to style whats in the tables.

Full on standards based, non-table sites are possible commerically, but can be a lot harder to do with little prior knowledge, and a good stepping stone is certainly a form of hybrid layout using bits of both.

Though XHTML isn't meant as a straight forward replacement for HTML4.01, I think HTML will eventually die off in favour of XHTML. Some sites can achieve a 50% reduction in code size when moving to fairly full XHTML based coding. In itself, XHTML is only meant to be a stepping stone towards full on XML. I think XHTML will survive there as going to full XML requires a fair bit of extra knowledge to use well, its less intuitive and more extreme, and therefore less accessible to people wanting to make sites.

#13 TopDog

TopDog

    HR 3

  • Active Members
  • PipPipPip
  • 59 posts
  • Location:Mesa, AZ

Posted 04 February 2004 - 11:24 AM

Ditto to everything Adrian said.

I'm a speed freak when it comes to web page design. I was sold on the code reduction aspects of XHTML the first time I tried it.

Craig ;)

#14 Randy

Randy

    Convert Me!

  • Moderator
  • 17,540 posts

Posted 04 February 2004 - 11:28 AM

Scottie,

Since Adrian also mention Jeffrey Zeldman, I've got a pretty decent book of his that I picked up at Amazon. It's entitled "Designing with Web Standards". It gives you a good foundation for XHTML/CSS. And as Adrian indicated, he is pretty concerned about standards, but also being realistic.

That might be a good place for you to start. I found it to be a pretty easy read and quite helpful getting a grasp on the major concepts.

#15 K.S. Katz

K.S. Katz

    HR 4

  • Active Members
  • PipPipPipPip
  • 172 posts

Posted 04 February 2004 - 11:38 AM

Scottie,

Also check out Sitepoint's HTML Utopia: Designing without Tables using CSS. It's a great book.

One of my favorite CSS design sites is CSSZenGarden.com. Of course there's some browser compatibility issues if you use Opera, but I love the concept of designing without tables. They really showcase what you can do w/ CSS design.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users