programming-examples/css/Div tag position relative absolute.html

37 lines
1.1 KiB
HTML
Raw Permalink Normal View History

2019-11-15 12:59:38 +01:00
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>Div Tag Position Relative Absolute</title>
<style type='text/css'>
div {
padding: 12px;
border: 1px solid pink;
opacity: 0.7;
background: yellow;
}
div#div1 {
position: relative;
margin: 40px;
}
div#div2 {
position: absolute;
top: 23px;
left: 23px;
}
</style>
</head>
<body>
<div id='div1'>
When love is in excess it brings a man no honor nor worthiness.<br><br>
Euripides
<div id='div2'>
Love is not enough. It must be the foundation,<br>
the cornerstone - but not the complete structure.<br>
It is much too pliable, too yielding.<br><br>
Bette Davis
</div>
</div>
</body>
</html>