Use the id attribute to style text with CSS: - HTML CSS HTML Global Attribute

HTML CSS examples for HTML Global Attribute:id

Description

Use the id attribute to style text with CSS:

Demo Code

ResultView the demo in separate window

<html>
<head>
<style>
#myHeader {<!--from   w w w.  j  a  va2 s  .  c  o m-->
    color: red;
    text-align: center;
}
</style>
</head>
<body>

<h1 id="myHeader">W3Schools is the best!</h1>

</body>
</html>

Related Tutorials