背景图像定位

如果背景图像不进行重复,你可以使用background-position属性来指定背景图像在浏览器窗口中的位置。这个位置可以随便变换。

<html>
    <head>
        <title>TODO supply a title</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <style type="text/css">
            body {
		background-image: url("tulip.gif");
		background-repeat: no-repeat;
		background-position: center center;
		color: #665544;
		padding: 20px;}
        </style>
    </head>
    <body>
        <div>TODO write content</div>
        <h1>Planting Guide</h1>
	<h2>Magnolia</h2>
	<p><b><i>Magnolia grandiflora</i></b>, commonly known as the <b>Southern magnolia</b> or <b>bull bay</b>, is a tree of the family Magnoliaceae native to the southeastern United States, from coastal Virginia south to central Florida, and west to eastern Texas and Oklahoma. Reaching 27.5 m (90 ft) in height, it is a large striking evergreen tree with large dark green leaves and large white fragrant flowers. Widely cultivated around the world, over a hundred cultivars have been bred and marketed commercially. The timber is hard and heavy, and has been used commercially to make furniture, pallets, and veneer.</p>
    </body>
</html>

 

posted @ 2018-08-11 17:11  梦人亭  阅读(145)  评论(0编辑  收藏  举报