문제

What is the significant differences between using CSS to center something on a page, rather than the tags?

Will affect page layout, compatibility etc?

Much Thanks.

도움이 되었습니까?

해결책

The <center> tag has been deprecated in HTML4 (and XHTML1) in favor of the CSS text-align property, which can be applied to the <div> element or to an individual <p>.

For more info: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/center

It is always better to separate the "code" (HTML) and the styles (CSS), so in any case, CSS is the way to go.

다른 팁

To be short, just don't use center tag. Let it go into oblivion together with marquee.

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/center

<center> is an HTML tag, which is now depreciated

It's beter to use CSS prepriety instead: it's because it's better to isolate the structure (HTML) and design (CSS)

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top