帮我看下这个网页中的三个图片div的大小和位置怎么更改设置

我想更换几张大图,但是无论放多大的图片都会局限在这个边框里,怎么样才能更改所放图片的大小和位置呢?

图片说明

下边的图其实我放了一张很大的图,但是都会按比例缩放到这个位置,怎么才能更改默认图片的长宽?和位置?

图片说明

<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CSS3鼠标悬停图片遮罩层动画特效</title>

<!--bootstrap布局框架-->
<link rel="stylesheet" type="text/css" href="css/bootstrap-grid.min.css" />

<!--字体图标样式-->
<link rel="stylesheet" type="text/css" href="https://cdn.bootcss.com/font-awesome/4.6.0/css/font-awesome.min.css">

<style>
body{background-color: #353535}
.box {
    font-family: 'Ubuntu', sans-serif;
    overflow: hidden;
    position: relative;
    transition: all 0.3s;
}
.box:hover {
    box-shadow: 0 0 15px -5px #000;
}
.box:before {
    content: '';
    background-color: transparent;
    background-image: radial-gradient(circle at 20% 80%, transparent 29%, rgba(255,255,255,0.4) 30%, rgba(255,255,255,0.4) 33%, transparent 34%),  radial-gradient(circle at 80% 20%, transparent 29%, rgba(255,255,255,0.4) 30%, rgba(255,255,255,0.4) 33%, transparent 34%);
    background-size: 30px 30px;
    height: 100%;
    width: 100%;
    opacity: 0;
    position: absolute;
    left: 0;
    top: 0;
    z-index: 1;
    transition: all 0.3s ease 0.2s;
}
.box:hover:before {
    opacity: 1;
}
.box img {
    width: 100%;
    height: auto;
    transition: all 0.3s ease 0s;
}
.box:hover img {
    filter: blur(2px);
}
.box .box-content {
    color: #fff;
    background-color: rgba(0,0,0,0.6);
    text-align: center;
    width: 100%;
    height: 59%;
    padding: 18% 0 0 0;
    position: absolute;
    left: 0;
    top: -100%;
    z-index: 2;
    transition: all 0.3s ease 0s;
}
.box:hover .box-content {
    top: 0;
}
.box .title {
    color: #fff;
    font-size: 23px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin: 0;
}
.box .post {
    color: #32c287;
    font-size: 14px;
    font-style: italic;
    text-transform: capitalize;
    letter-spacing: 2px;
}
.box .icon {
    background: rgba(50,194,135,0.6);
    text-align: center;
    height: 39%;
    width: 100%;
    padding: 15px 0 0;
    margin: 0;
    list-style: none;
    transform: translateX(50%);
    position: absolute;
    right: 50%;
    bottom: -100%;
    z-index: 1;
    transition: all 0.3s;
}
.box:hover .icon {
    bottom: 0;
}
.box .icon li {
    display: inline-block;
    margin: 0 3px;
}
.box .icon li a {
    color: #32c287;
    background-color: #fff;
    font-size: 18px;
    line-height: 40px;
    height: 40px;
    width: 40px;
    border-radius: 40%;
    display: block;
    transition: all 0.3s;
}
.box .icon li a:hover {
    color: #fff;
    background-color: #04a562;
    box-shadow: 0 0 0 3px rgba(255,255,255,0.5), 0 0 5px rgba(0,0,0,0.5) inset;
}

@media only screen and (max-width:990px) {
.box {
    margin-bottom: 30px;
}
}

@media only screen and (max-width:479px) {
.box .title {
    font-size: 20px;
}
}
</style>
</head>
<body>

<h4 style="text-align: center; color: aliceblue;line-height: 50px">CSS3图片鼠标悬停动画特效 <span>Hover Effect Style</span></h4>

<div class="demo">
<div class="container">
    <div class="row">

        <div class="col-md-4 col-sm-6">
            <div class="box">
                <img src="images/img-1.jpg" alt="">
                <div class="box-content">
                    <h3 class="title">餐饮软件</h3>
                    <span class="post">web developer</span>
                </div>
                <ul class="icon">
                    <li><a href="#"><i class="fa fa-search"></i></a></li>
                    <li><a href="#"><i class="fa fa-link"></i></a></li>
                </ul>
            </div>
        </div>

        <div class="col-md-4 col-sm-6">
            <div class="box">
                <img src="images/img-2.jpg" alt="">
                <div class="box-content">
                    <h3 class="title">零售软件</h3>
                    <span class="post">web designer</span>
                </div>
                <ul class="icon">
                    <li><a href="#"><i class="fa fa-search"></i></a></li>
                    <li><a href="#"><i class="fa fa-link"></i></a></li>
                </ul>
            </div>
        </div>

        <div class="col-md-4 col-sm-6">
            <div class="box">
                <img src="images/img-3.jpg" alt="">
                <div class="box-content">
                    <h3 class="title">会员系统</h3>
                    <span class="post">web developer</span>
                </div>
                <ul class="icon">
                    <li><a href="#"><i class="fa fa-search"></i></a></li>
                    <li><a href="#"><i class="fa fa-link"></i></a></li>
                </ul>
            </div>
        </div>

    </div>
</div>
</div>
<div style="text-align:center;margin:50px 0; font:normal 14px/24px 'MicroSoft YaHei';color:#ffffff">
<p>适用浏览器:360、FireFox、Chrome、Opera、傲游、搜狗、世界之窗. 不支持Safari、IE8及以下浏览器。</p>
<p>来源:<a href="https://www.lanrenzhijia.com/" target="_blank">懒人</a></p>
</div>
</body>
</html>

1个回答

.box img {
width: 100%;
height: auto;
transition: all 0.3s ease 0s;
}
把这里面的调整就完事了

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐