Author Topic: How to write HTML & CSS in a professional manner?  (Read 1051 times)

0 Members and 1 Guest are viewing this topic.

Offline nickkTopic starter

  • Irregular
  • Posts: 15
    • View Profile
How to write HTML & CSS in a professional manner?
« on: March 19, 2010, 05:23:09 AM »
In a follow up to my post on how to code PHP in a professional manner (http://www.phpfreaks.com/forums/index.php/topic,291398.0.html), I decided to start this one :p

Background:
Have been coding for a number of years, but nothing that was accessible to a large amount of people, so my HTML & CSS was randomly thrown together (I think 90% of it was divs with floats and clears lol) and tweaked until it sort of worked in Firefox and IE.

I don't want to be an HTML & CSS expert (in any case I'm not very artistic) but I want to be able to make correct, professional looking sites to go with my PHP code. Since I really enjoyed the nettuts tutorials on CodeIgniter, I looked through their website and came across this tutorial:
http://net.tutsplus.com/tutorials/html-css-techniques/html-5-and-css-3-the-techniques-youll-soon-be-using/

It seems like a great intro to good markup practices.

My questions:
 - Are the HTML5 tags supported by most browsers?
 - Is this tutorial sufficient as an intro to HTML & CSS?
 - Do you guys know of any great CSS tutorials which go somewhat past the basics?

Any other tips, etc. would be appreciated.

Thanks!

Offline Tazerenix

  • Enthusiast
  • Posts: 228
  • Gender: Male
  • Call me taz :D
    • View Profile
    • Tazerenix Productions
Re: How to write HTML & CSS in a professional manner?
« Reply #1 on: March 20, 2010, 04:14:31 AM »
Currently you shouldn't be using HTML5 tags in any of your webpages. These are not supported by most browsers. You should use HTML4 standards. Of course w3schools.com has a decent tutorial for that as it is the official international standard for HTML. I don't know any really good tutorials for either HTML or CSS though as i am self taught in the 2.
Try looking at some high quality templates or professionally designed websites for good practice. You should always try to code in XHTML Strict 1.0 where possible. CSS should be used for all design of your webpage.
Quote
"War does not determine who is right... Only who is dead" - Unknown



NOTE: Most of the code I post is untested. So hope for the best

Offline thorpe

  • Administrator
  • 'Mind Boggling!'
  • *
  • Posts: 29,255
    • View Profile
Re: How to write HTML & CSS in a professional manner?
« Reply #2 on: March 20, 2010, 08:12:43 AM »
Quote
Of course w3schools.com has a decent tutorial for that as it is the official international standard for HTML.

w3schools.com has NOTHING at all to do with defining any web standards, it is a tutorial site like any other.
« Last Edit: March 20, 2010, 08:13:14 AM by thorpe »

Offline haku

  • Guru
  • Freak!
  • *
  • Posts: 5,707
  • Old Man
    • View Profile
Re: How to write HTML & CSS in a professional manner?
« Reply #3 on: March 20, 2010, 08:33:18 AM »
And depending on your site and target audience, it's entirely fine to code in HTML 5. If it's a personal site, I see no problem with doing it in HTML 5, as long as you are prepared to accept that some users will not be able to access it.

Offline Tazerenix

  • Enthusiast
  • Posts: 228
  • Gender: Male
  • Call me taz :D
    • View Profile
    • Tazerenix Productions
Re: How to write HTML & CSS in a professional manner?
« Reply #4 on: March 20, 2010, 08:13:54 PM »
Quote
Of course w3schools.com has a decent tutorial for that as it is the official international standard for HTML.

w3schools.com has NOTHING at all to do with defining any web standards, it is a tutorial site like any other.
i mean w3c
Quote
"War does not determine who is right... Only who is dead" - Unknown



NOTE: Most of the code I post is untested. So hope for the best

Offline nickkTopic starter

  • Irregular
  • Posts: 15
    • View Profile
Re: How to write HTML & CSS in a professional manner?
« Reply #5 on: March 21, 2010, 04:49:45 AM »
No, the project I'm about to start will be used in a professional setting so I have to make sure its accessible to everyone.

Offline arbitter

  • Enthusiast
  • Posts: 342
  • Gender: Male
    • View Profile
Re: How to write HTML & CSS in a professional manner?
« Reply #6 on: March 21, 2010, 05:03:15 AM »
well, html5 is supported by google chrome, safari, and IE with a google chrome frame. At least that is with the h.264-videocodec. This is because browsersmakers have to pay to use this technology, and mozilla simply doesn't have the money for it, and it's not really necessary eather. Though I do believe in the future, everything will become html5, more than flash.

Offline ignace

  • Guru
  • Freak!
  • *
  • Posts: 5,093
  • Gender: Male
    • View Profile
Re: How to write HTML & CSS in a professional manner?
« Reply #7 on: March 21, 2010, 06:12:08 AM »
Quote
Though I do believe in the future, everything will become html5, more than flash.

1. No doubt it will become HTML 5 that's called progress
2. Flash is dead, Apple killed it! Bastards!

Quote
You should always try to code in XHTML Strict 1.0 where possible.

Only if you are just starting out with HTML programming otherwise you should use HTML 4. IE 8 for example does not support XHTML as it renders it as HTML

Many mistake to write XHTML while declaring Content-Type: text/html which should be according to W3C application/xhtml+xml. If you use PHP you should set the default_mimetype directive to application/xhtml+xml as it overwrites your HTML declared Content-Type
« Last Edit: March 21, 2010, 06:24:38 AM by ignace »
Developer from Belgium, Vlaams-Brabant

Offline haku

  • Guru
  • Freak!
  • *
  • Posts: 5,707
  • Old Man
    • View Profile
Re: How to write HTML & CSS in a professional manner?
« Reply #8 on: March 21, 2010, 12:47:06 PM »
well, html5 is supported by google chrome, safari, and IE with a google chrome frame... mozilla simply doesn't have the money for it

Firefox 3.6 has HTML5 support.
Quote
Though I do believe in the future, everything will become html5, more than flash.

1. No doubt it will become HTML 5 that's called progress
2. Flash is dead, Apple killed it! Bastards!

Quote
You should always try to code in XHTML Strict 1.0 where possible.

Only if you are just starting out with HTML programming otherwise you should use HTML 4. IE 8 for example does not support XHTML as it renders it as HTML

There is no should about it. It's purely a matter of decision. It's true that XHTML is not served as XHTML when using a text/html mimetype, but that doesn't make it wrong, it just doesn't give you any of the benefits you would get if you served it with an XHTML doctype.

There is a long running discussion going on the matter in this thread.

Offline patriklko

  • Irregular
  • Posts: 20
    • View Profile
Re: How to write HTML & CSS in a professional manner?
« Reply #9 on: March 25, 2010, 04:06:43 AM »
One tip is very important while using CSS is that :  All the css coding should be written in a separate external .css file and it should be linked in .html document. It helps to make the HTML document clean and light and also helps to edit the document formatting easily in one go just by editing a single file!

Offline ignace

  • Guru
  • Freak!
  • *
  • Posts: 5,093
  • Gender: Male
    • View Profile
Re: How to write HTML & CSS in a professional manner?
« Reply #10 on: March 25, 2010, 05:05:25 AM »
One tip is very important while using CSS is that :  All the css coding should be written in a separate external .css file and it should be linked in .html document. It helps to make the HTML document clean and light and also helps to edit the document formatting easily in one go just by editing a single file!

Not to mention you only need to change one line if you ever want to switch stylesheets
Developer from Belgium, Vlaams-Brabant