Does & need to be & in the meta description?

后端 未结 3 865
悲&欢浪女
悲&欢浪女 2020-12-18 21:44

I\'m inserting content which has the & sign. I would like to know if it\'s needed to insert it as & so this sign is read correctly.

3条回答
  •  庸人自扰
    2020-12-18 22:43

    You always represent an ampersand in HTML content as & or &, never a bare &. This includes both text between an element's tags, as well as attribute values. No exceptions.

    This is because & itself denotes the start of an HTML entity reference (as seen above) and can often cause problems when appearing in the middle of text that could be interpreted as an entity reference.

提交回复
热议问题