display&position_CSS/HTML

來源:互聯網
上載者:User
display:block 將子物件作為塊對象呈遞。很多內聯樣式的效果,需要用到display。
<style type="text/css">#photo a img{border:3px solid #FF6600; }#photo a:hover {display:block;} /**若不加此句,則內聯對象img的樣式不會顯示**/#photo a:hover img{ border:2px solid blue;}</style>
[Ctrl+A 全選 注:如需引入外部Js需重新整理才能執行]
position 內容的尺寸根據布局尺寸確定對象的尺寸。
<P><style type="text/css">#text{position:relative;} /**若沒有,則內聯對象不顯示。若為block,會作為區塊層級元素而使虛線過長。posigion時,長度由text的內容決定。**/#text span{width:200px; height:20px;border-bottom: 1px dashed #000000 ;}</style></p><P> <span> 樣本文字 底線樣式 </span></p>
[Ctrl+A 全選 注:如需引入外部Js需重新整理才能執行]
  • 相關文章

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.