How to code for this?

When we have this:

as
<html>
<head>
<style>
h2
{
letter-spacing:4pt;
font-size:40pt;
color:blue;
text-align:center;
position:absolute;
top:0px;
}
h3
{
letter-spacing:4pt;
font-size:40pt;
color:blue;
text-align:center;
position: absolute;
top:20px;
left:20px;
}
</style>
</head>
<body>
<h2>All right, Mate?</h2>
<h3>All right, Mate?</h3>
</body>
</html>
</html>
…without changing the original functionality/tags.
Only add (or modify) a bit.
You can put both in a wrapper with
positionset torelativeand define a fixedwidthandheightto it.HTML
CSS
It’s necessary to define a
heightbecause both elements have thepositionset toabsolute, it makes the elements to be removed from the normal flow of the document, so the parent element, in this case the wrapper, won’t add theheightof the absolute positioned children to its own.Also, note that defining the parent’s
positiontorelativewill affect the position of the children, as their position will be calculated in relation to the parent’s position. If you don’t want this behaviour just remove theposition: relativefrom the.wrapperrule.Live example
Hope it helps.