美文网首页
静态资源的简单使用

静态资源的简单使用

作者: 求墨者 | 来源:发表于2018-12-27 16:41 被阅读5次

添加icon

icon快速制作 https://instafavicon.com/

<head>
    <link rel="icon" href="{{ url_for('static', filename='favicon.ico') }}">
</head>

添加图片

免费图片网站 https://unsplash.com/

<body>
    <img alt="Avatar" src="{{ url_for('static', filename='images/avatar.png') }}">
</body>

添加CSS

CSS布局快速入门
https://learnlayout.com/

<head>
    <link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}" type="text/css">
</head>

static/style.css

/* 页面整体 */
body {
    margin: auto;
    max-width: 580px;
    font-size: 14px;
    font-family: Helvetica, Arial, sans-serif;
}

/* 页脚 */
footer {
    color: #888;
    margin-top: 15px;
    text-align: center;
    padding: 10px;
}

/* 列表 */
.software-list {
    list-style-type: none;
    padding: 0;
    margin-bottom: 10px;
    box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12);
}

.software-list li {
    padding: 12px 24px;
    border-bottom: 1px solid #ddd;
}

.software-list li:last-child {
    border-bottom:none;
}

.software-list li:hover {
    background-color: #f8f9fa;
}

/* pug */
.pug {
    display: block;
    margin: 0 auto;
    height: 100px;
}

相关文章

网友评论

      本文标题:静态资源的简单使用

      本文链接:https://www.haomeiwen.com/subject/rnqdlqtx.html