Position the <h1> element 50px from the left, and 100px from the top, relative to the HTML page. - HTML CSS CSS

HTML CSS examples for CSS:Quiz

Description

Position the <h1> element 50px from the left, and 100px from the top, relative to the HTML page.

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<head>
<style>
h1 {<!--from   w w  w.jav  a 2 s .co m-->
    position: absolute;
    top: 100px;
    left: 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