Friday, May 23, 2014

HTML TUTORIAL PART 45

HTML TUTORIAL PART 45

PROBLEM:
LOOK AT THE FOLLOWING:

This is a heading with no position

This heading is moved upwards according to its normal position

Note: Even if the content of the relatively positioned element is moved, the reserved space for the element is still preserved in the normal flow.

SOLVED:
THE CODE BELOW MADE THE HTML TIP:

<!DOCTYPE html>
<html>
<head>
<style>
h2.pos_top
{
position:relative;
top:-50px;
}
</style>
</head>

<body>
<h2>This is a heading with no position</h2>
<h2 class="pos_top">This heading is moved upwards according to its normal position</h2>
<p><b>Note:</b> Even if the content of the relatively positioned element is moved, the reserved space for the element is still preserved in the normal flow.</p>
</body>

</html>

No comments:

Post a Comment