Blogger Information
Blog 27
fans 2
comment 0
visits 19612
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
phpcnUi用flex布局---PHP九期线上班
一丁
Original
553 people have browsed it

phpcnUi用flex布局


html代码:

实例

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>phpcnUi用flex布局</title>
    <link rel="stylesheet" href="static/css/style/demo1.css">
</head>
<body>
<header>
    <a href="#"><div class="logo"><img src="https://www.php.cn/static/images/logo.png" alt=""></div></a>
    <h1><i>phpcn UI</i>用户参考手册</h1></header>
<main>
    <article>
        <div class="iframe" id="content">
            <!--            文档内容区-->
            <iframe src="welcome.html" frameborder="0" name="content" ></iframe>
        </div>
    </article>
    <aside>
        <ul class="ul1" id="nav">
            <li  style="cursor: pointer;" class="li1"><strong>前端基础</strong>
                <ul class="hide ul3">
                    <li><a href="base/1_框架安装.html" target="content">框架安装</a></li>
                    <li><a href="base/2_页面结构.html" target="content">页面结构</a></li>
                    <li><a href="base/3_常用标签.html" target="content">常用标签</a></li>
                    <li><a href="base/4_CSS选择器.html" target="content">CSS选择器</a></li>
                    <li><a href="base/5_CSS样式控制.html" target="content">CSS样式控制</a></li>
                    <li><a href="base/6_CSS盒模型.html" target="content">CSS盒模型</a></li>
                    <li><a href="base/7_CSS浮动与定位.html" target="content">CSS浮动与定位</a></li>
                    <li><a href="base/8_CSS常用布局方式.html" target="content">CSS常用布局方式</a></li>
                   </ul>
            </li>

            <li style="cursor: pointer;"><strong>框架组件</strong>
                <ul class="ul3 hide">
                    <li><a href="component/1_栅格布局.html" target="content">栅格布局</a></li>
                    <li><a href="component/2_常用样式.html" target="content">常用样式</a></li>
                    <li><a href="component/3_文本与背景色.html" target="content">文本与背景色</a></li>
                    <li><a href="component/4_表格.html" target="content">表格</a></li>
                    <li><a href="component/5_分页条.html" target="content">分页条</a></li>
                </ul>
            </li>
        </ul>
    </aside>
</main>
<footer>php中文网©版权所有(2019)</footer>
<script>
    // 控制导航折叠
    var menus = document.querySelectorAll('#nav > li');
    menus.forEach(function (menu){
        menu.firstElementChild.addEventListener('click', function (evt) {
            evt.target.nextElementSibling.classList.toggle('hide');
        }, false);
    });
</script>

</body>
</html>

运行实例 »

点击 "运行实例" 按钮查看在线实例



CSS代码:


实例

/*****************初始化*******************/
*{
    padding: 0;
    margin: 0;
}
a{
    text-decoration: none;
    color: #ffd300;
}
li{
    list-style:none;
}
strong{
    color: #200772;
}
/******************顶部*******************/
header{
    display: flex;
    flex-flow: row nowrap;
    background: #071a0b;
    width: 100%;
    height: 50px;
    min-width: 320px;
}
header a{
    display: flex;
}
header a .logo{
    display: flex;
    align-items: center;
    padding-left:20px;
}

header h1{
    display: flex;
    margin: 0 auto;
    align-items: center;
    font-weight: 400;
    color:whitesmoke;
    font-size: 29px;
}
header h1 i{
    color: #ff7f50;
    text-shadow: 2px 2px 2px whitesmoke;
    padding-right: 8px;
}

/******************左侧*******************/
.hide {
    display: none;
}
main{
    display: flex;
    padding-bottom: 50px;
}
main aside ul a:hover{
    color: #ffaa00;
    font-weight: bolder;
    text-shadow: 2px 2px 1px black;
}
main aside{
    background-color: #6c8cd5;
    width: 230px;
    min-height: 95.5vh;
    order: -1;

}
main aside .ul1{
    padding: 40px;
}
main aside .ul1 .li1{
    padding-bottom:10px;
}
main aside .ul1 li .ul3{
padding-left: 15px;
}
main aside .ul1 li .ul3 li{
    padding-top: 10px;
}
main article{
    flex:1;
    min-width: 320px;
}
main article iframe{
    width: 100%;
    height: 95.5vh;
}


/******************底部*******************/
footer{
    width: 100%;
    height: 50px;
    display: flex;
    position:fixed;
    bottom:0;
    background: black;
    color: whitesmoke;
    justify-content: center;
    align-items: center;
}

运行实例 »

点击 "运行实例" 按钮查看在线实例


手写:

image.png

运行结果图:


image.png



总结


        这两周虽然很辛苦,每天都要手写代码,感觉回到了读书时候,但是效果还是很明显的,很多以前不太懂的知识点,现在已经知道什么意思.能看着一个网站,大概知道怎么布局,应该运用什么元素,能模仿网站出来.

以前就自学过一段时间,后来因为工作原因和金钱原因,没能参加第一期的PHP培训班,现在落下那么多,要好好学习,要做一个IT成功人士.

Correction status:qualified

Teacher's comments:原来你从第一期就开始关注我们了,那可是二年前呀, 纠结时间够长的啦... 不过, 没关系的, 什么时候开始不重要, 开始了才重要
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post