@AidarKhas

Как уменьшить отступы изображения в данном коде (HTML-CSS)?

Добрый день,
Как уменьшить отступы между изображениями в данном коде? Готовый CSS код нашел и скопировал на одном из сайтов по CSS эффектам. Сам я еще очень зеленый в этой теме и плохо разбираюсь в синтаксисе кода, прошу помочь добрых людей. В общем, здесь 6 изображений с гиперссылкой и эффектом CSS при наведении курсора на изображение.

<style>
/* Общие стили */
*, *:after, *:before { 
border-box;
box-sizing: border-box;
}
.clearfix:before, .clearfix:after { 
	content: ''; 
	display: table; 
}
.clearfix:after { 
	clear: none; 
}
.hover-text-one {
	overflow: hidden;
	margin: 0;
	width: 100%;
	list-style: none;
	text-align: center;
}
.hover-text-one figure {
	position: relative;
	z-index: 1;
	display: inline-block;
	overflow: hidden;
	background: #527c82;
	text-align: center;
	cursor: pointer;
}
.hover-text-one figure img {
	position: relative;
	display: block;
	min-height: 100%;
	opacity: 0.8;
}
.hover-text-one figure figcaption {
	padding: 2em;
	color: #fff;
	text-transform: uppercase;
	font-size: 1.25em;
	-webkit-backface-visibility: hidden;
	backface-visibility: hidden;
}
.hover-text-one figure figcaption::before,
.hover-text-one figure figcaption::after {
	pointer-events: none;
}
.hover-text-one figure figcaption{
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
}
.hover-text-one figure h3 {
	word-spacing: -0.15em;
	font-weight: 300;
}
.hover-text-one figure h3 span {
	font-weight: 800;
}
.hover-text-one figure h3,
.hover-text-one figure p {
	margin: 0;
}
.hover-text-one figure p {
	letter-spacing: 1px;
	font-size: 68.5%;
}

/* Эффект при наведении */
figure.effect-text-three {
	background: #527c82;
}
figure.effect-text-three img {
	width: -webkit-calc(100% + 20px);
	width: calc(100% + 20px);
	-webkit-transition: opacity 0.35s, -webkit-transform 0.35s;
	transition: opacity 0.35s, transform 0.35s;
	transform: scale(1.1);
	-webkit-backface-visibility: hidden;
	backface-visibility: hidden;
}
figure.effect-text-three:hover img {
	opacity: 0.4;
	-webkit-transform: translate3d(0,0,0);
	transform: translate3d(0,0,0);
}
figure.effect-text-three figcaption {
	text-align: left;
}
figure.effect-text-three h3 {
	position: relative;
	overflow: hidden;
	padding: 0.5em 0;
}
figure.effect-text-three h3::after {
	position: absolute;
	bottom: 0;
	left: 0;
	width: 100%;
	height: 3px;
	background: #fff;
	content: '';
	-webkit-transition: -webkit-transform 0.35s;
	transition: transform 0.35s;
	-webkit-transform: translate3d(-100%,0,0);
	transform: translate3d(-100%,0,0);
}
figure.effect-text-three:hover h3::after {
	-webkit-transform: translate3d(0,0,0);
	transform: translate3d(0,0,0);
}
figure.effect-text-three p {
	padding: 1em 0;
	opacity: 0;
	-webkit-transition: opacity 0.35s, -webkit-transform 0.35s;
	transition: opacity 0.35s, transform 0.35s;
	-webkit-transform: translate3d(100%,0,0);
	transform: translate3d(100%,0,0);
}
figure.effect-text-three:hover p {
	opacity: 1;
	-webkit-transform: translate3d(0,0,0);
	transform: translate3d(0,0,0);
}
</style>
<div class="hover-text-one">
  <figure class="effect-text-three">
    <a href="https://...."><img src="https://....JPG" width "200" height="200" alt="Button1"/>
      <figcaption>
	<h3 style="color: white; font-weight: bold">Text 1</h3>
	<p>Text 2</p>
      </figcaption>			
  </figure>
<figure class="effect-text-three">
    <a href="https://...."><img src="https://....JPG" width "200" height="200" alt="Button2"/>
      <figcaption>
	<h3 style="color: white; font-weight: bold">Text1</h3>
	<p>Text2</p>
      </figcaption>			
  </figure>
<figure class="effect-text-three">
    <a href="https://..."><img src="https://.....JPG" width "200" height="200" alt="Button3"/>
      <figcaption>
	<h3 style="color: white; font-weight: bold">Text1</h3>
	<p>Text2</p>
      </figcaption>			
  </figure>
</br>
<figure class="effect-text-three">
    <a href="https://...."><img src="https://.....JPG" width "200" height="200" alt="Button4"/>
      <figcaption>
	<h3 style="color: white; font-weight: bold">Text1</h3>
	<p>Text2</p>
      </figcaption>			
  </figure>
<figure class="effect-text-three">
    <a href="https://...."><img src="https://.....JPG" width "200" height="200" alt="Button5"/>
      <figcaption>
	<h3 style="color: white; font-weight: bold">Text1</h3>
	<p>Text2</p>
      </figcaption>			
  </figure>
<figure class="effect-text-three">
    <a href="https://...."><img src="https://.....JPG" width "200" height="200" alt="Button6"/>
      <figcaption>
	<h3 style="color: white; font-weight: bold">Text1</h3>
	<p>Text2</p>
      </figcaption>			
  </figure>
</div>
  • Вопрос задан
  • 123 просмотра
Решения вопроса 2
@alekcena
Нелинейный наставник
Отступы:
padding - внутренний отступ у блока.
margin - внешний отступ у блока
Ответ написан
@Kypidon4ik
Фрилансер, Wordpress developer
figure.effect-text-three: margin:0;
Ответ написан
Комментировать
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы