gpt4 book ai didi

html - 选择图像的哪一部分显示在小于图像大小的容器中

转载 作者:太空宇宙 更新时间:2023-11-04 09:54:04 24 4
gpt4 key购买 nike

我不知道如何选择我在网站主页上使用的图像的底部。

它自动从上到下开始,但我想选择要查看的部分,这将在图像的下方。

html

<!DOCTYPE html>
<html>

<head>
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.4.0/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="Stylesheet.css">
<title>Kilbride Classic Cuisine</title>
</head>

<body>
<div id="toplocation">
<i class="fa fa-fax"></i> (01)-8393790&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
<i class="fa fa-map-marker">&nbsp Unit 10,11,12, Baldoyle Industrial Estate, Dublin 13, Ireland</a></i>
</div>
<div class="container-fluid">
<div id="menu">
<ul id="menu">
<li><a href="#Home">Home</a></li>
<li><a href="#OurProducts">Our Products</a></li>
<li><a href="#OurBrands">Our Brands</a></li>
<li><a href="Aboutpage.php">Contact Us</a></li>
</ul>
</div>
</div>

<div class="imgwrap">
<div id="img1">

</div>
</div>

CSS

html,
body {
width: 100%;
height: 100%;
margin: 0px;
padding: 0px;
overflow-x: hidden;
font-family: sans-serif, arial;
}

#toplocation {
background-color: #4d4d4d;
color: White;
margin-top: 0;
margin-bottom: 0;
margin-right: 0;
margin-left: 0;
padding-top: 5px;
padding-right: 5px;
padding-bottom: 5px;
padding-left: 100px;
}

.container-fluid {
background-color: #fb0e3d;
width: 100%;
text-align: center;
margin: 0 auto;
margin-bottom: 0px;
}


/*.column{
text-align: center;
margin: 0 auto;
background-color:#b93333;
}*/

#menu {
margin: 0 auto;
display: inline-block;
list-style: none;
padding: 0;
border-top: 1 solid #ccc;
border-left: 1 solid #ccc;
border-bottom: 1 solid #000000;
}

#menu li {
float: left;
background-color: #fb0e3d;
}

#menu li a {
display: block;
border-bottom-right-radius: 0pxpx;
border-bottom-left-radius: 0pxpx;
padding: 40px;
width: 120px;
text-decoration: none;
color: white;
border-right: 1px solid #ccc;
font-weight: bold;
}

#menu li a:hover {
color: #fb0e3d;
background-color: #fff;
}

div.imgwrap {
width: 100%;
height: 350px;
max-width: MaxSize;
max-height: MaxSize;
border: 3px solid #4d4d4d;
background-image: url('quiche.jpg');
background-size: cover;
background-repeat: no-repeat;
margin: 0px;
padding: 0;
position: absolute;
}

#contact {
margin-top: 30px;
text-align: center;
font-size: 30px;
color: #fb0e3d;
font-weight: bold;
}

#imgcontainer {
width: 80%;
height: 30%;
align: center;
}

#info {
margin-left: 50px;
font-family: Arial, Helvetica, sans-serif;
}

#map {
align: right;
width: 30%;
height: 30%;
}

最佳答案

在下面的链接中查看 background-position 属性。

http://www.w3schools.com/cssref/pr_background-position.asp

这将允许您指定图像的起始位置。例如,您可以指定 background-position: center bottom; 以显示图像的中下部分。或者,您可以指定以像素为单位的绝对值。

关于html - 选择图像的哪一部分显示在小于图像大小的容器中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38874183/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com