【发布时间】:2020-06-06 04:43:03
【问题描述】:
我有一个 div 内的图像映射。当我加载页面时,地图图像溢出了 div,所以我必须滚动到页面的右侧。我想要它,这样图像就在页面上,而不必向右滚动。
我尝试使用img{width: 100%},但这使得地图链接无法点击。
.uc {
background: linear-gradient(to right, red, white, black);
margin: auto;
vertical-align: middle;
border-radius: 15px;
box-shadow: 20px 20px 10px #888888;
width: 25%;
height: 50px;
display: flex;
justify-content: center;
align-items: center;
}
h1 {
text-align: center;
background-color: white;
opacity: 0.8;
}
body {
background-image: url("back.png");
background-repeat: repeat-x;
}
.descrip {
border-color: black;
border: 2px solid;
background-color: white;
padding-left: 10px;
padding-right: 10px;
width: 80%;
margin-left: auto;
margin-right: auto;
}
img {
width: 100%;
}
<body>
<h1>Lesson 2</h1>
<div class="descrip">
<h1>Interactive Diagram</h1>
<p>Click on the below image to explore various parts of the motherboard including: </p>
<ul>
<li>CMOS Battery</li>
<li>SLI Chip</li>
<li>CPU Socket</li>
<li>RAM Sockets</li>
</ul>
<img src="mb1.png" alt="Motherboard" usemap="#mbmap">
<map name="mbmap">
<area shape="rect" coords="220,794, 478, 1668" href="https://en.wikipedia.org/wiki/Random-access_memory"
alt="RAM">
<area shape="rect" coords="547,493,1007,743" href="https://en.wikipedia.org/wiki/Scalable_Link_Interface"
alt="SLI Chip">
<area shape="rect" coords="569,1072, 975, 1468" href="https://en.wikipedia.org/wiki/Central_processing_unit"
alt="CPU Socket">
<area shape="circle" coords="618,186,64" href="https://en.wikipedia.org/wiki/Nonvolatile_BIOS_memory"
alt="CMOS">
</map>
</div>
<hr>
<div class="uc">
<a href="hw4.html">< < LESSON 1</a>
</div>
</body>
【问题讨论】:
标签: html css image-size