小编Gau*_* SK的帖子

如何在div的底部中心对齐图像

我想将图像对齐到div 的底部,并且还希望将其水平居中.

这就是我想要完成的事情(如下图所示),但在我的项目中,母牛之间存在巨大差距.牛的图片被切成两半,所以我希望底部部分在响应时粘在视口的底部.

在此输入图像描述

HTML:

<div class="main">
    <div class="container">

        <div class="nav">
            <ul>
                <li><a href="index.html" >Work</a></li>
                <li><a href="about.html">About</a></li>
                <li><a href="contact.html">Contact</a></li>
            </ul>
        </div>

        <div class="main_text">
            <h1>Awh Cow! I got no <span class="yellow">Dribbble</span>.</h1>
            <p>Invite me to Dribbble maybe? Thanks.</p>
        </div>

        <a href="mailto:hi@gauthamsk.com" class="button">Visit Profile</a>

        <div class="cow"></div>

    </div> <!-- end container -->
</div> <!-- end main -->
Run Code Online (Sandbox Code Playgroud)

CSS:

.cow {
    height: 280px; /* Change this height to change the size of the cow */
    background: url(../images/cow.png) bottom center no-repeat;
    background-size: contain; …
Run Code Online (Sandbox Code Playgroud)

html css position

3
推荐指数
1
解决办法
2994
查看次数

如何在包含'%s'的字符串中打印'%'?

我希望输出是这样的

我正在使用'%s'打印出来:你好!

我的代码:

print "I'm using %s to print this out: %s" % "hello!"
Run Code Online (Sandbox Code Playgroud)

这会返回错误.

python python-2.7

-2
推荐指数
1
解决办法
64
查看次数

标签 统计

css ×1

html ×1

position ×1

python ×1

python-2.7 ×1