Browse Source

nth-child

twt 3 years ago
parent
commit
5e38fd56e9
1 changed files with 9 additions and 5 deletions
  1. 9 5
      pages/homePage/homePage.vue

+ 9 - 5
pages/homePage/homePage.vue

@@ -128,7 +128,7 @@
 
 						<!-- 照片 -->
 						<view class="imgBg">
-							<view v-for="(itemImg,indexImg) in item.imgs" :key="indexImg">
+							<view v-for="(itemImg,indexImg) in item.imgs" :key="indexImg" class="pjimgBox">
 
 								<image :src="itemImg.imageUrl" class="img"
 									@click="previewImage(itemImg.imageUrl,item.imgs)"></image>
@@ -763,13 +763,17 @@
 	.img {
 		width: 140rpx;
 		height: 140rpx;
-		margin-right: 31rpx;
-		margin-bottom: 10rpx;
+		
+		margin-bottom: 18rpx;
 		border-radius: 8rpx;
 	}
-	.img:nth-child(4n){
-		margin-right: 0;
+	.pjimgBox{
+	   margin-right: 31rpx;
 	}
+
+	.pjimgBox:nth-child(4n){
+		margin-right: 0 !important;
+	} 
 	.writeBack {
 		font-size: 26rpx;
 		color: #666666;