Do you know a HTML-Snippet Validator?

前端 未结 2 876
眼角桃花
眼角桃花 2021-02-06 21:52

I\'m searching for a tool that would allow me to check whether a certain snippet of HTML would be valid in it\'s proper context.

I\'d input something like



        
2条回答
  •  半阙折子戏
    2021-02-06 22:19

    You can actually use the W3C validator to check a snippet.

    Choose the 'Validate by Direct Input' tab and select More Options. In there there is a radio button to 'Validate HTML fragment'. http://validator.w3.org/#validate_by_input+with_options

    It will wrap your page in valid html so the errors which you see are only due to your snippet.

提交回复
热议问题