有一个 div,该 div 内有一个图像,所有边距设置为 0 - 但是它一直在 div 内显示一个 gab,甚至没有在外面,它不是填充或边距,我似乎无法弄清楚它是什么.
我试图将 Div 更改为部分,给它们负边距,使高度为 100%,但没有任何效果!
这是该网站的链接:http ://www.webdesignstudents.co.uk/students/loai_shehadeh/1/portfolio.html 您可以通过查看页面源来查看完整代码,但这里是我使用的 HTML这:
<div class="wrapperB">
<div class="content">
<div id="portfolio-sectionB" class="all">
<div id="grid1"><!--Gird 1-->
<div class="galleryItemB visualIdentity">
<img alt="Brighton and Hove In Bloom Logo" src="portfolio/images/brighton-in-bloom-logo-mockup-1.jpg">
<a href="portfolio/brighton-in-bloom.html"></a>
</div>
<div class="galleryItemB visualIdentity">
<img alt="" src="portfolio/images/hovecollege-course-magazine-mockup2.jpg">
<a href="portfolio/hovecollege-course-magazine.html"><p>Click To View Project</p></a>
</div>
<div class="galleryItemB visualIdentity">
<img alt="" src="portfolio/images/brighton-pet-show-poster-mockup3.jpg">
<a href="portfolio/brighton-pet-show.html"><p>Click To View Project</p></a>
</div>
</div><div id="grid2"><!--Gird 2-->
<div class="galleryItemB visualIdentity">
<img alt="" src="portfolio/images/ambition-world-bussiness-card-mockup.jpg">
<a href="portfolio/ambition-world.html"><p>Click To View Project</p></a>
</div>
</div><div id="grid3"><!--Gird 3-->
<div class="galleryItemB visualIdentity">
<img alt="" src="portfolio/images/brighton-pet-show-logo-mockup.jpg">
<a href="portfolio/brighton-pet-show.html"><p>Click To View Project</p></a>
</div>
<div class="galleryItemB webDesign visualIdentity">
<img alt="" src="portfolio/images/animal-recuse-group-logo-mockup.jpg">
<a href="portfolio/animal-rescue-group.html"><p>Click To View Project</p></a>
</div>
</div>
</div>
</div>
</div>
CSS
#portfolio-sectionA {
margin: 10px 20px;
}
#portfolio-sectionA a {
color: #CED9E7;
padding: 7px 10px;
margin-left: -1px;
border-radius: 3px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
}
#portfolio-sectionA a:hover {
color: #9BAFCE;
}
#portfolio-sectionA a:active, #portfolio-sectionA a.portfolio-sectionAClicked {
color: #4E6C98;
background-color: #3C5476;
cursor: default;
}
/*---Portoflio Page Section B---*/
.galleryItemB {
background-color: green;
position: relative;
}
#portfolio-sectionB .galleryItemB a {
position: absolute; left: 0; top: 0; right: 0; bottom: 0;
background: url(../elements/magnifying-glass.png) center center no-repeat rgba(78,108,152,.85);
cursor: pointer;
opacity: 0;
-moz-opacity: 0;
-khtml-opacity: 0;
filter:alpha(opacity=0);
-webkit-transition: opacity 0.2s linear;
-moz-transition: opacity 0.2s linear;
-ms-transition: opacity 0.2s linear;
-o-transition: opacity 0.2s linear;
transition: opacity 0.2s linear;
}
#portfolio-sectionB .galleryItemB:hover a {
opacity: 1;
-moz-opacity: 1;
-khtml-opacity: 1;
filter:alpha(opacity=100);
}
#portfolio-sectionB .galleryItemB a p{
color: #FFFFFF;
position: absolute; bottom: 15px; right: 20px;
cursor: pointer;
}