Code:
<html>
<head>
<style>
#banner {
position: relative;
width: 778px;
margin: 0 auto;
height: 212px;
background: url(imgs/banner.jpg);
}
#topmenu {
position: absolute;
bottom: 0px;
right: 0px;
width: 564px; height: 32px;
background: url(imgs/bgr_topbar1.gif) repeat-x;
}
</style>
</head>
<body>
<div id="banner">
<div id="topmenu">
</div>
</div>
1. Gõ chính xác là bottom: 0px; right: 0px; thì chắc chắn sẽ nằm ở bottom right của cái #banner.
2. Format Position với các thông số như Top, Left, Right, Bottom đòi hỏi đầu tiên là phải có position Relative. Nó sẽ format position theo cái div nào chứa nó với thuộc tính relative.
Nguyên văn document sử dụng 1 trong 4 cái đó tiếng anh như sau: (Cái này Bottom)
For absolutely positioned boxes, specifies how far from the bottom of the containing box (
which is the first containing relatively positioned box or the page itself) the box should be.
For relatively positioned boxes, specifies how far from the bottom a box should be shifted.
Được sửa bởi Spirit lúc 16:27 ngày 08-03-2008
Dzooooooooooooooooooooooooooooooooooo
Bookmarks