programming-examples/css/Background image position left right top bottom.html
2019-11-15 12:59:38 +01:00

47 lines
1.5 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:subLang="en">
<head>
<title>background image position left right top bottom</title>
<style>
body {
font: 16px sans-serif;
margin: 15px;
color: blue;
background-color: #FFFFCC;
}
h1 {
font: 24px Arial;
margin: 22px;
padding: 36px;
border: 2px solid;
}
h1.left {
background-image: url(background-image.gif);
background-repeat: no-repeat;
background-position: left;
}
h1.right {
background-image: url(background-image.gif);
background-repeat: no-repeat;
background-position: right;
}
h1.bottom {
background-image: url(background-image.gif);
background-repeat: no-repeat;
background-position: bottom;
}
h1.center {
background-image: url(background-image.gif);
background-repeat: no-repeat;
background-position: center;
}
</style>
</head>
<body>
<h1>Nothing is miserable unless you think it is so. Boethius </h1>
<h1 class="left">background-position: left; I can live without money, but I cannot live without love. Judy Garland </h1>
<h1 class="right">background-position: right; Sometimes the heart sees what is invisible to the eye. H. Jackson Brown, Jr. </h1>
<h1 class="bottom">background-position: bottom; Love ceases to be a pleasure, when it ceases to be a secret. Aphra Behn </h1>
<h1 class="center">background-position: center; What will survive of us is love Philip Larkin </h1>
</body>
</html>