当前位置: 移动技术网 > IT编程>网页制作>CSS > 【代码笔记】Web-CSS-CSS Display

【代码笔记】Web-CSS-CSS Display

2019年02月02日  | 移动技术网IT编程  | 我要评论

一,效果图。

二,代码。

复制代码
<!doctype html>
<html>

<head>
    <meta charset="utf-8">
    <title>css display(显示)</title>
    <style>
    h1.hidden {
        display: none;
    }
    
    li {
        display: inline;
    }
    
    span {
        display: block;
    }
    </style>
</head>

<body>
    <h1>this is a visible heading</h1>
    <h1 class="hidden">this is a hidden heading</h1>
    <p>notice that the hidden heading still takes up space.</p>
    <ul>
        <li><a href="/html" target="_blank">html</a></li>
        <li><a href="/css/" target="_blank">css</a></li>
        <li><a href="/js/" target="_blank">javascript</a></li>
        <li><a href="/xml/" target="_blank">xml</a></li>
    </ul>
    <h2>nirvana</h2>
    <span>record: mtv unplugged in new york</span>
    <span>year: 1993</span>
    <h2>radiohead</h2>
    <span>record: ok computer</span>
    <span>year: 1997</span>
</body>

</html>
复制代码

 

参考资料:《菜鸟教程》

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网