我试图让我的图像和段落项目的边框,但我不知道如何做到这一点。我将它们装入div中,并为它们添加了一个类,但背景颜色和边框效果什么也不做。这就是我对拍摄:HTML/CSS边框多个元素
这是我的HTML代码看起来像本节:
<div class="pair">
<a href="GPA_Calc_Screen.png">
<img src="GPA_Calc_Screen.png" alt""> <!--Relative img path -->
</a>
<p>
This is a custom GPA Calculator, and what I like to think is the first real app that I made. Going to Georgia Tech, and college in general, this is a vital asset. Although at GT we don't operate on the plus/minus system, I added a setting in which you can edit that if you want.
</p>
</div>
,这里是我的CSS:
.pair div {
display: block;
/*padding: 5px;
clear: right;
width: 100%;
border-radius: 5px;
border-width: 3px;
border-color: red;*/
background: red;
}
试过了,什么也没有显示出来 –
https://jsfiddle.net/mfjgLzn3/ –
@Josephhooper输出是什么? –