Position the <h1> element relative to the browser window. 50px from the top, and 50px from the right. - HTML CSS CSS

HTML CSS examples for CSS:Quiz

Description

Position the <h1> element relative to the browser window. 50px from the top, and 50px from the right.

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<head>
<style>
h1 {<!--  ww w .j  a v a 2  s.  c  om-->
    position: fixed;
    top: 50px;
    right: 50px;
    color: red;
}
</style>
</head>
<body>

<h1>This is a Heading</h1>
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>

</body>
</html>

Related Tutorials