• 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
  • 相关阅读:
    IDEA中用好Lombok,撸码效率至少提升5倍
    在 IDEA 中使用 Debug,真是太厉害了!
    彻底理解cookie,session,token
    优秀的程序员一定要多写博客!
    IntelliJ IDEA 从入门到上瘾教程,2019图文版!
    注解配置
    过滤器(登录认证)
    过滤器
    Session监听器
    request监听器
  • 原文地址:https://www.cnblogs.com/feilv/p/4086400.html
Copyright © 2020-2023  润新知