{"id":2919,"date":"2009-12-10T08:27:07","date_gmt":"2009-12-10T08:27:07","guid":{"rendered":"http:\/\/aceinfowayindia.com\/blog\/?p=2919"},"modified":"2019-01-10T17:51:16","modified_gmt":"2019-01-10T17:51:16","slug":"5-simple-ways-to-keep-your-code-friendly","status":"publish","type":"post","link":"https:\/\/aceinfowayindia.com\/blog\/2009\/12\/5-simple-ways-to-keep-your-code-friendly\/","title":{"rendered":"5 Simple Ways To Keep Your Code Friendly"},"content":{"rendered":"<p>There are thousands of blogs and tutorials websites are available on the internet but not all of the information is useful or of good quality.  In this Article We&#8217;ll show you 5 ways to keep your code browser, user and search engine friendly. Keep follow this few steps, and i definitely sure that will helps you for your next website project. Enjoy it!<\/p>\n<p>[ad#co-1]<br \/>\n<!--more--><br \/>\n<a href=\"http:\/\/aceinfowayindia.com\/blog\/wp-content\/uploads\/2009\/12\/5-simple-ways-to-keep-your-code-friendly.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/aceinfowayindia.com\/blog\/wp-content\/uploads\/2009\/12\/5-simple-ways-to-keep-your-code-friendly.jpg\" alt=\"5-simple-ways-to-keep-your-code-friendly\" title=\"5-simple-ways-to-keep-your-code-friendly\" width=\"550\" height=\"296\" class=\"alignnone size-full wp-image-2937\" srcset=\"https:\/\/aceinfowayindia.com\/blog\/wp-content\/uploads\/2009\/12\/5-simple-ways-to-keep-your-code-friendly.jpg 550w, https:\/\/aceinfowayindia.com\/blog\/wp-content\/uploads\/2009\/12\/5-simple-ways-to-keep-your-code-friendly-300x161.jpg 300w\" sizes=\"auto, (max-width: 550px) 100vw, 550px\" \/><\/a><\/p>\n<h4>1. Write clean code<\/h4>\n<p>Writing clean code will be easily maintainable and less of a pain for you and others.<\/p>\n<p><strong>Bad Code<\/strong><\/p>\n<pre>\r\n[code lang=\"htmlstrict\"]\r\n<div id=\"Wrapper\">\r\n     <div id=\"MainContainer\">\r\n<div id=\"Header\"><\/div>\r\n    <div id=\"Content\"><\/div>\r\n <\/div>\r\n     <\/div>\r\n[\/code]\r\n<\/pre>\n<p><strong>Good Code<\/strong><\/p>\n<pre>\r\n[code lang=\"htmlstrict\"]\r\n<!-- \/ WRAPPER \\ -->\r\n<div id=\"Wrapper\">\r\n\r\n   <!-- \/ MAIN CONTAINER \\ -->\r\n   <div id=\"MainContainer\">\r\n       \r\n       <!-- \/ HEADER \\ -->\r\n       <div id=\"Header\"><\/div>\r\n       <!-- \\ HEADER CLOSE \/ -->\r\n       \r\n       <!-- \/ CONTENT \\ -->\r\n       <div id=\"Content\"><\/div>\r\n       <!-- \\ CONTENT CLOSE \/ -->\r\n    \r\n   <\/div>\r\n    <!-- \\ MAIN CONTAINER CLOSE \/ -->\r\n\r\n<\/div>\r\n<!-- \\ WRAPPER CLOSE \/ -->\r\n[\/code]\r\n<\/pre>\n<h4>2. Use the correct DOCTYPE  <\/h4>\n<p>If you don&#8217;t use the DOCTYPE(document type declaration) tag, your Web pages won&#8217;t display in standards compliant ways and might result in some strange Web pages.<\/p>\n<h4>3. Use Heading Tags and Unordered lists<\/h4>\n<p>Use Heading Tags and Unordered lists rather then spacer graphics and nested tables..<\/p>\n<p><strong>Bad Code<\/strong><\/p>\n<p>[code lang=&#8221;htmlstrict&#8221;]<\/p>\n<table>\n<tr>\n<th>Heading<\/th>\n<\/tr>\n<tr>\n<td>\n               Content xyz<br \/>\n               Content xyz<br \/>\n               Content xyz<br \/>\n               Content xyz\n           <\/td>\n<\/tr>\n<\/table>\n<p>[\/code]<\/p>\n<p><strong>Good Code<\/strong><\/p>\n<pre>\r\n[code lang=\"htmlstrict\"]\r\n<div>\r\n    <h2>Heading<\/h2>\r\n    <ul>\r\n        <li>Content xyz<\/li>\r\n        <li>Content xyz<\/li>\r\n        <li>Content xyz<\/li>\r\n        <li>Content xyz<\/li>\r\n    <\/ul>\r\n<\/div>\r\n[\/code]\r\n<\/pre>\n<h4>4. Use semantically meaningful class &amp; ID names<\/h4>\n<p>Whenever possible, use class and ID names that are semantically meaningful and search-friendly. For example:<\/p>\n<p><strong>Bad Code<\/strong><\/p>\n<pre>\r\n[code lang=\"htmlstrict\"]\r\n<ul class=\"blue\">  \r\n      <li>Error 1<\/li>  \r\n     <li>Error 2<\/li>  \r\n <\/ul>  \r\n[\/code]\r\n<\/pre>\n<p><strong>Good Code<\/strong><\/p>\n<pre>\r\n[code lang=\"htmlstrict\"]\r\n<ul class=\"Error\">  \r\n      <li>Error 1<\/li>  \r\n     <li>Error 2<\/li>  \r\n <\/ul>  \r\n[\/code]\r\n<\/pre>\n<h4>5. Avoid IE\u2019s double float-margin, Use Display: inline for floated elements<\/h4>\n<p>Avoid IE\u2019s double float-margin and text indent bugs by using display:inline for floated elements.<\/p>\n<p><strong>Bad Code<\/strong><\/p>\n<pre>\r\n[code lang=\"css\"]\r\n#content {\r\n    float: left;\r\n    width: 300px;\r\n    padding: 4px 7px;\r\n    margin-left: 20px;\r\n}\r\n[\/code]\r\n<\/pre>\n<p><strong>Good Code<\/strong><\/p>\n<pre>\r\n[code lang=\"css\"]\r\n#content {\r\n    float: left;\r\n    width: 300px;\r\n    padding: 4px 7px;\r\n    margin-left: 20px;\r\n    display: inline;\r\n}\r\n[\/code]\r\n<\/pre>\n<h4>Conclusion<\/h4>\n<p>These are just some of the tips that help me to write better code. I hope that tutorial will also help you to write better and clean code. Apply these Tips to your current and next projects, and you will surely appreciate the efforts.<\/P><\/p>\n<p><strong>If You Think that tutorial can be more better , Please share with us. Comment us<\/strong><\/p>\n<p>if you would like to receive more Tips from us, please consider subscribing to our feed by <a href=\"http:\/\/feeds.feedburner.com\/developers-paradise\"><strong>RSS<\/strong><\/a> or by <a href=\"http:\/\/feedburner.google.com\/fb\/a\/mailverify?uri=developers-paradise&#038;loc=en_US\"><strong>email<\/strong><\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>There are thousands of blogs and tutorials websites are available on the internet but not all of the information is useful or of good quality. In this Article We&#8217;ll show you 5 ways to keep your code browser, user and &hellip; <a href=\"https:\/\/aceinfowayindia.com\/blog\/2009\/12\/5-simple-ways-to-keep-your-code-friendly\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,56,57],"tags":[52,23,5],"class_list":["post-2919","post","type-post","status-publish","format-standard","hentry","category-css","category-tutorials","category-web-development","tag-css","tag-tutorials","tag-web-development"],"_links":{"self":[{"href":"https:\/\/aceinfowayindia.com\/blog\/wp-json\/wp\/v2\/posts\/2919","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/aceinfowayindia.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/aceinfowayindia.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/aceinfowayindia.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/aceinfowayindia.com\/blog\/wp-json\/wp\/v2\/comments?post=2919"}],"version-history":[{"count":19,"href":"https:\/\/aceinfowayindia.com\/blog\/wp-json\/wp\/v2\/posts\/2919\/revisions"}],"predecessor-version":[{"id":3203,"href":"https:\/\/aceinfowayindia.com\/blog\/wp-json\/wp\/v2\/posts\/2919\/revisions\/3203"}],"wp:attachment":[{"href":"https:\/\/aceinfowayindia.com\/blog\/wp-json\/wp\/v2\/media?parent=2919"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/aceinfowayindia.com\/blog\/wp-json\/wp\/v2\/categories?post=2919"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/aceinfowayindia.com\/blog\/wp-json\/wp\/v2\/tags?post=2919"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}