HTML <center> تگ

HTML5 ਨਹੀਂ ਸਮਰਥਨ ਕਰਦਾ ਹੈ。

<center> ਟੈਗ HTML4 ਵਿੱਚ ਮੱਧ ਸਥਿਤੀ ਵਿੱਚ ਟੈਕਸਟ ਦੀ ਵਰਤੋਂ ਵਿੱਚ ਵਰਤਿਆ ਜਾਂਦਾ ਹੈ。

ਕੀ ਵਰਤਣਾ ਹੈ?

ਉਦਾਹਰਣ 1

ਟੈਕਸਟ ਦੀ ਮੱਧ ਸਥਿਤੀ (CSS ਦੀ ਵਰਤੋਂ ਨਾਲ):

<html>
<head>
<style>
h1 {text-align: center;}
p {text-align: center;}
div {text-align: center;}
</style>
</head>
<body>
<h1>ਇਹ ਸਿਰਲੇਖ ਹੈ</h1>
<p>ਇਹ ਇੱਕ ਪੈਰਾਗ੍ਰਾਫ ਹੈ。</p>
<div>ਇਹ ਇੱਕ div ਹੈ。</div>
</body>
</html>

ਆਪਣੇ ਅਨੁਸਾਰ ਕਰੋ