对高端网站的追求从未停止
当前位置: 首页 > 新闻资讯 > 技术文章

HTML5与CSS3设计模式

发布: 2020年12月29日 浏览:

[html]    一、背景设计模式

    <style type="text/css">

    div { background:#f00 url("images/divbg.jpg") no-repeat; width:200px; height:66px; }

    </style>

    <h1>Background Image(背景设计模式)</h1>

    <div></div>

    二、绝对定位设计模式

    <style type="text/css">

    *.positioned { position:relative; }

    *.absolute { position:absolute; top:20px; left:20px; }

    </style>

    <h1>Absolute(绝对定位设计模式)</h1>

    <div class="positioned">

    <span class="absolute">Sized Absolute</span>

    </div>

    <style type="text/css">

    *.positioned { border:1px solid red; height:80px; background-color:#ff0000; }

    *.absolute { border:5px solid green; background-color:#000000; }

    </style>

    三、文本替换设计模式

    <style type="text/css">

    #h2 { position:relative; width:240px;height:66px; overflow:hidden; }

    #h2 span { position:absolute; width:240px; height:66px; top:0; left:0; background:#ff0 url("images/divbg.jpg") no-repeat; }

    </style>

    <h1>Text Replacement(文本替换设计模式)</h1>

    <h2 id="h2">heading 2<span></span></h2>

    四、左旁注设计模式

    <style type="text/css">

    *.left-marginal { position:relative; margin-left:200px; }

    *.marginal-heading { position:absolute; top:0; left:-200px; margin:0; }

    </style>

    <h1>Left Marginal(左旁注设计模式)</h1>

    <div class="left-marginal">

    <h2 class="marginal-heading">Heading</h2>

    You want to excerpt an element and move it into the left again.

    </div>

    五、旁注式图片下沉设计模式

    <style type="text/css">

    *.indent { position:relative; margin-left:120px; }

    *.graphic-dropcap { position:absolute; width:120px; height:90px; left:-120px; top:0; }

    *.graphic-dropcap span { position:absolute; width:120px; height:90px; margin:0; top:0; left:0; background:url(images/m.jpg) no-repeat; }

    </style>

    <h1>Marginal Graphic Dropcap(旁注式图片下沉设计模式)</h1>

    <p class="indent">

    <span class="graphic-dropcap">M<span></span></span>

    arginal Graphic Dropcap. The letter M has been covered by the dropcap is image.Screen readers  read the text and visual users see the image.If the browser cannot display the dropcap image, the text becomes visible.

    </p> 


您准备好了吗?
称呼: 手机:
或拨打:135-8576-7893
  • 上海小程序制作

    微信公众号

  • 网站制作

    客服微信号

  • 业务咨询 135-8576-7893

    (7*24) 小时贴心服务

    在线咨询
    关于宿橙 COPYRIGHT © 2008-2024 上海宿橙网络技术有限公司 ALL RIGHTS RESERVED沪ICP备14017448号-10

    地址:上海市嘉定区鹤旋路58号816室(江桥万达广场8号写字楼)

    售前咨询135-8576-7893
    通过微信扫码联系客服
    Top