Principles for writing better HTML code

12
12 Principles to keep your code clean By http://www.psd2htmlwordpress.com

description

This pdf is made by http://www.psd2htmlwordpress.com/ generating the ideas for writing clean HTML code.

Transcript of Principles for writing better HTML code

Page 1: Principles for writing better HTML code

12 Principles to keep your code clean

By http://www.psd2htmlwordpress.com

Page 2: Principles for writing better HTML code

Advantages of Clean Coding

• Less amount of bugs will be there due to clean coding which will lead to better website design

• With less amount of HTML code it will be easier for the developer to judge what code is doing what.

• Loading time of the website will be fast

• Saves time and money

Page 3: Principles for writing better HTML code

Strict DOCTYPE • It is an instruction to the web browser about what version

of HTML the page is written in.

• DOCTYPE Declaration

Page 4: Principles for writing better HTML code

Character set & encoding characters

• Properly encodation of funny characters must be done to avoid any misinterpretation

Page 5: Principles for writing better HTML code

Proper indentation

• Proper indentation must be done as it is easier to

read and debug

• Always indent one tab

Page 6: Principles for writing better HTML code

Keep your CSS and JavaScript external

• Use external CSS and JavaScript

• Future pages can link to them

• Changing the design on multiple pages become easy

Page 7: Principles for writing better HTML code

Nest tags properly

• Nesting of tags must be done properly

• Opened tags must be closed in the reverse order. E.G. <i><b>This is my sentence of text.</b></i>

Page 8: Principles for writing better HTML code

Eliminate unnecessary divs

• Minimize the use of div tag

• Make debugging and editing easier.

Page 9: Principles for writing better HTML code

Use better naming conventions

• Use meaningful naming conventions

Page 10: Principles for writing better HTML code

Validate

• Run the code through the ol’ validator machine to

pick up small mistakes • Validated code is certain to outlive non-validated

code.

Page 11: Principles for writing better HTML code

Contact Info

PSD to HTML Wordpress www.psd2htmlwordpress.com

Y8,Block EP,Sec – v

Salt Lake, Kol – 700091,India

PH : +913340200838

Email:[email protected]

Page 12: Principles for writing better HTML code

Thank You