为什么< center>仍然可以在HTML 5中工作? [英] Why <center> can still work in html 5?

查看:30
本文介绍了为什么< center>仍然可以在HTML 5中工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<!DOCTYPE html> 将页面指定为html5.但是,当我使用< center> 时,它仍然可以使内容居中.当我从 http://读到的内容时,为什么< center> 仍能在html 5中工作www.w3schools.com/tags/应该认为< center> 不起作用?

<!DOCTYPE html> specifies the page as html 5. But, when I used <center>, it can still center the content. Why <center> can still work in html 5 as I read from http://www.w3schools.com/tags/ that <center> is supposed to not work?

推荐答案

自HTML4以来,该标记已过时.但是即使现在,某些浏览器仍支持它. MDN 建议不要使用它

The tag is obsolete since HTML4. But it is still supported in some browsers even now. MDN advices to not use it

已过时

该功能已过时.尽管它可能在某些浏览器中仍然可以使用,但是不建议使用它,因为可以随时将其删除.尝试避免使用它.

This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it.

改为使用CSS text-align:center .

这篇关于为什么&lt; center&gt;仍然可以在HTML 5中工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆