zoukankan      html  css  js  c++  java
  • html知识收集(一)

    1.页内跳转iframe

    <ul>

    <li><a href="1.html" target="iframe1">1</a></li>

    <li><a href="2.html" target="iframe1">2</a></li>

    </ul>

    </ul>

    <iframe name="iframe1" src="0.html"></iframe>

    2.打开链接

    <a href="url" target="_blank">新窗口中打开</a>

    <a href="url" target="_parent">在原窗口中打开</a>

    3.text元素设为只读

    <input type="text" disabled readonly />

    4.css技巧

    默认样式值:* {margin: 0; padding: 0; background-color: transparent;}

    css中子元素自动继承父元素的属性值

    对同一元素的css定义有多种,以最近的定义为最优先

    一个标签可以定义多个class

    派生选择器:div p {}

    组选择器:h1, h2 {}

    不需要给背景图片加引号:background-image: url(images/a.gif)

    正确的顺序指定连接样式:a:link, a:visited, a:hover, a:active

    调试技巧:使用background,避免用border,因为border可能会改变div大小

     5.div布局实例

    <!DOCTYPE html>
    <html>
    <head>
    <style type="text/css">
    #container {
        position: absolute;
        background-color: pink;
        left: 100px;
        top: 100px;
        right: 100px;
        bottom: 100px;
    }
    #header {
        height: 40px;
        background-color: yellow;
    }
    #content {
        position: absolute;
        background-color: silver;
        width: 100%;
        top: 40px;
        bottom: 40px;
    }
    #left {
        position: absolute;
        background-color: purple;
        width: 200px;
        height: 100%;
    }
    #right {
        position: absolute;
        background-color: purple;
        width: 200px;
        height: 100%;
        right: 0px;
    }
    #footer {
        position: absolute;
        width: 100%;
        height: 40px;
        bottom: 0;
        background-color: cyan;
    }
    </style>
    </head>
    <body>
    <div id="container">
        <div id="header"></div>
        <div id="content">
            <div id="left"></div>
            <div id="center"></div>
            <div id="right"></div>
        </div>
        <div id="footer"></div>
    </div>
    </body>
    </html>
    View Code
  • 相关阅读:
    (48)zabbix报警媒介:自定义脚本Custom alertscripts
    Centos7下cratedb数据导入导出copy to copy from
    CentOS7下cratedb备份及恢复(快照)
    Centos7下mysql5.7.22主从配置
    Centos7安装配置MySQL5.7
    Centos7安装配置iptable
    Centos7 LNMP 一键安装
    Centos7防范SYN
    Centos7安装RabbitMQ解决Erlang依赖报错
    centos7安装配置zabbix4.0
  • 原文地址:https://www.cnblogs.com/feilv/p/4086400.html
Copyright © 2011-2022 走看看