Breaking

Thursday, April 25, 2013

Một số kiểu hiển thị cố định trên màn hình làm menu hoặc quảng cáo


Một kiểu đơn giản có thể dùng làm menu (thường áp dụng làm menu top) hoặc quảng cáo góc dưới màn hình. Điểm mấu chôt ở đây chính là thuộc tính position: fixed; cố định vùng trên màn hình máy tính.

  • Nếu muốn làm menu top thì chọn top:0px, width:100%
  • nếu muốn làm quảng cáo thì chọn bottom:1px, left:1px hoặc right:1px;
<style>
  #ad-rl{
    right: 5px;bottom: 5px;
    position: fixed;
    width:auto;
    border:1px solid #999;
    padding:10px;
    background: #E4e4e4;
  }
</style>

<div id="ad-rl">
  <a target="_blank" href="http://phim.bendoi.vn">Phim</a><br/>
  <a target="_blank" href="http://music.bendoi.vn">music</a><br/>
  <a target="_blank" href="http://it.bendoi.vn">it</a><br/>
  <a target="_blank" href="http://web.bendoi.vn">web</a><br/>
  <a target="_blank" href="http://test.bendoi.vn">test</a><br/>
  <a target="_blank" href="http://news.bendoi.vn">news</a><br/>
  <a target="_blank" href="http://ebook.bendoi.vn">ebook</a><br/>
  <a target="_blank" href="http://graphic.bendoi.vn">graphic</a><br/>
</div>
Xem demo hiện tượng tại trang này!


Làm nút top/bottom đơn giản
 <a style="position: fixed; Top: 100px; right:10px;" href="#" title="Về đầu trang">
<img src="http://png-3.findicons.com/files/icons/2127/ultimate_gnome/22/go_top.png"></a>
<a style="position: fixed; Top: 150px; right: 10px;" href="javascript:scroll(0,9999999)" title="Xuống cuối trang">
<img src="http://png-4.findicons.com/files/icons/2127/ultimate_gnome/24/bottom.png"></a>

Làm nút top/bottom đơn giản Xem demo trên trang này!

No comments:

Post a Comment