tailieunhanh - HOW TO DESIGN AND WRITE WEB PAGES TODAY phần 6
Tất cả các ngôn ngữ máy tính có một số loại cú pháp để viết bình luận có nghĩa là đối với con người, không máy tính. Để giúp làm cho trang web của bạn bền vững hơn, đó là khôn ngoan để có được vào các thói quen bình luận về mã nguồn của bạn. | WRITING WITH SOURCE IN A TEXT EDITOR 143 Every computer language has some sort of syntax for writing comments that is meant for humans not computers. To help make your pages more sustainable it s wise to get into the habit of commenting on your source. Not only will comments make it easier for you to edit your pages in the future but it will also help you to think through what you are doing. If you describe in the comments what your source means and what you intend it to do you will deepen your understanding of how Web languages work. So in addition to formatting your source for readability using line breaks and indentation you can also write comments to your source. In XHTML comments begin with -- and end with -- . For example --Here is a comment in XHTML comments are not rendered on your page in the browser nor is the browser affected by their contents. However it is actually the two hyphens -- that close the comment so do not use a double-hyphen in your comment text itself. This is a hard habit to break for those of us who use two hyphens in email to mimic an em dash. CSS and JavaScript both use a slash-star star-slash pattern to start and end comments Here is a comment in CSS Here is a comment in JavaScript Writing Useful Comments Writing useful comments is an art of writing all its own. When written well comments can explain aspects of your source you can also throw in line breaks and tabs on your comments too display none For fully graphical screen displays hide links that are used to skip to different page sections Here are some general tips for writing useful comments Write comments as though you were trying to teach or explain what you re doing to someone else. Many teachers will tell you that they never really learn a subject until they ve taught it to 144 HOW TO DESIGN AND WRITE WEB PAGES TODAY others. Writing comments that attempt to teach and explain will help others who might look at the source of your pages and it will help your .
đang nạp các trang xem trước