What's the point of valid CSS/HTML?

前端 未结 17 1990
梦如初夏
梦如初夏 2020-11-30 06:40

If I\'ve tested my pages in most major browsers, why would I need to maintain a validated code? I want to use box-shadows and corner radius if they\'re supported in WebKit b

17条回答
  •  日久生厌
    2020-11-30 07:25

    I'd say valid (X)HTML is a must, since this defines how your content can be accessed. Badly formed HTML can stop your content from being "read" by not only humans but also machines (think search-engines, spiders etc). Imagine if a bank held your account details in a badly formed XML file and then sent that XML to another bank as part of a transaction - there is a danger that the bank would mis-read the amounts due to the different way it tried to interpret the sums.

    Valid CSS is slightly different as it is purely stylistic and effects presentation, not content. Therefore it is not as essential to keep it valid, so long as you don't mind different user agents presenting your content in different ways.

提交回复
热议问题