<!DOCTYPE html>
<html>
<head>
<title>Thuộc tính background-position-x right trong CSS</title>
<style>
#mtdiv {
background-image: url(https://webmoi.vn/thumuc/ceo-bui-tan-luc.jpg);
border: 2px solid black;
padding: 25px;
min-height:300px;
background-repeat: no-repeat; /*Không lặp lại hình nền*/
background-attachment: fixed; /*Cho đứng hình nền*/
color:red;
}
</style>
</head>
<body>
<h1>Thuộc tính background-position-x right trong CSS</h1>
<p>Lấy phần bên phải theo chiều ngang của hình nền canh vào phần bên phải theo chiều ngang của phần tử HTML: background-position-x: right;</p>
<div id="mtdiv" style="background-position-x: right;">
<p>Lấy phần bên phải theo chiều ngang của hình nền canh vào phần bên phải theo chiều ngang của phần tử HTML</p>
</div>
<p><b>Hình gốc:</b></p>
<img src="https://webmoi.vn/thumuc/ceo-bui-tan-luc.jpg" style="width:100%; height:auto">
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>Thuộc tính background-position-x right trong CSS</title>
<style>
#mtdiv {
background-image: url(https://webmoi.vn/thumuc/ceo-bui-tan-luc.jpg);
border: 2px solid black;
padding: 25px;
min-height:300px;
background-repeat: no-repeat; /*Không lặp lại hình nền*/
background-attachment: fixed; /*Cho đứng hình nền*/
color:red;
}
</style>
</head>
<body>
<h1>Thuộc tính background-position-x right trong CSS</h1>
<p>Lấy phần bên phải theo chiều ngang của hình nền canh vào phần bên phải theo chiều ngang của phần tử HTML: background-position-x: right;</p>
<div id="mtdiv" style="background-position-x: right;">
<p>Lấy phần bên phải theo chiều ngang của hình nền canh vào phần bên phải theo chiều ngang của phần tử HTML</p>
</div>
<p><b>Hình gốc:</b></p>
<img src="https://webmoi.vn/thumuc/ceo-bui-tan-luc.jpg" style="width:100%; height:auto">
</body>
</html>