На веб-странице появились отступы между блоками, хотя я их не указывал

85
26 февраля 2021, 13:20

Как убрать отступы между блоками? Свойства padding и margin не работают.

body { 
  min-width: 1360px 
} 
 
header { 
  min-height: 100%; 
  height: 240px; 
  background-color: #e9e9e9; 
} 
 
.logo { 
  margin-top: 38px; 
  margin-left: 100px; 
} 
 
.menu { 
  margin-top: -30px; 
} 
 
.menu a { 
  text-decoration: none; 
  display: inline-block; 
  color: #1d1d1d; 
} 
 
.text { 
  font-family: 'Montserrat', sans-serif; 
  margin-right: 50px; 
  font-size: 12px; 
  letter-spacing: 1px; 
  word-spacing: 20px; 
  font-weight: bolder; 
  margin-right: 30px; 
} 
 
.indent { 
  font-family: 'Montserrat', sans-serif; 
  margin-right: 50px; 
  font-size: 12px; 
  letter-spacing: 1px; 
  word-spacing: 20px; 
  font-weight: bolder; 
  margin-right: 40px; 
  text-indent: 610px; 
  margin-top: -30px; 
  text-align: right; 
} 
 
.menu a:hover { 
  text-decoration: none; 
  color: lightskyblue; 
} 
 
.banner { 
  background-color: lightpink; 
  height: 420px; 
  margin: none; 
} 
 
.web1 { 
  text-align: right; 
  font-family: 'Montserrat', sans-serif; 
  color: #1d1d1d; 
  font-weight: bold; 
  font-size: 40px; 
  word-spacing: 20px; 
  letter-spacing: 0.5px; 
}
<link href="https://fonts.googleapis.com/css?family=Montserrat&display=swap" rel="stylesheet"> 
<link href="https://fonts.googleapis.com/css?family=Montserrat&display=swap" rel="stylesheet"> 
 
 
 
<header> 
  <img src="logo.png" alt="" class="logo"> 
  <div class="menu"> 
    <a href="#" onMouseOut='getElementyById' (menu1).style.display="none" ; onMouseover="getElementyById" (menu1).style.display="block" ;> 
      <p class="text indent">HOME</p> 
    </a> 
    <a href="#" onMouseOut="getElementyById" (menu2).style.display='none' ; onmouseover="getElementyById" (menu2).style.display="block" ;> 
      <p class="text">ABOUT</p> 
    </a> 
    <a href="#" onMouseOut="getElementyById" (menu3).style.display='none' ; onmouseover="getElementyById" (menu2).style.display="block" ;> 
      <p class="text">WORK</p> 
    </a> 
    <a href="#" onMouseOut="getElementyById" (menu4).style.display='none' ; onmouseover="getElementyById" (menu2).style.display="block" ;> 
      <p class="text">PROCESS</p> 
    </a> 
    <a href="#" onMouseOut="getElementyById" (menu5).style.display='none' ; onmouseover="getElementyById" (menu2).style.display="block" ;> 
      <p class="text">SERVICES</p> 
    </a> 
    <a href="#" onMouseOut="getElementyById" (menu6).style.display='none' ; onmouseover="getElementyById" (menu2).style.display="block" ;> 
      <p class="text">TESTIMONIALS</p> 
    </a> 
    <a href="#" onMouseOut="getElementyById" (menu7).style.display='none' ; onmouseover="getElementyById" (menu2).style.display="block" ;> 
      <p class="text">CONTACT</p> 
    </a> 
  </div> 
</header> 
<div class="banner"> 
  <h2 class="web1">Web Design and Development</h2> 
  <p class="web2">We are a new design studio based in USA. We have over 20 years of combined experience, and know a thing or two about designing websites and mobile apps.</p> 
 
</div>

Answer 1

body { 
  margin: 0; 
  padding: 0; 
  min-width: 1360px 
} 
 
header { 
  min-height: 100%; 
  height: 240px; 
  background-color: #e9e9e9; 
} 
 
.logo { 
  margin-top: 38px; 
  margin-left: 100px; 
} 
 
.menu { 
  margin-top: -30px; 
} 
 
.menu a { 
  text-decoration: none; 
  display: inline-block; 
  color: #1d1d1d; 
} 
 
.text { 
  font-family: 'Montserrat', sans-serif; 
  margin-right: 50px; 
  font-size: 12px; 
  letter-spacing: 1px; 
  word-spacing: 20px; 
  font-weight: bolder; 
  margin-right: 30px; 
} 
 
.indent { 
  font-family: 'Montserrat', sans-serif; 
  margin-right: 50px; 
  font-size: 12px; 
  letter-spacing: 1px; 
  word-spacing: 20px; 
  font-weight: bolder; 
  margin-right: 40px; 
  text-indent: 610px; 
  margin-top: -30px; 
  text-align: right; 
} 
 
.menu a:hover { 
  text-decoration: none; 
  color: lightskyblue; 
} 
 
.banner { 
  background-color: lightpink; 
  height: 420px; 
  margin: none; 
} 
h2{margin: 0;padding: 0;} 
 
.web1 { 
  text-align: right; 
  font-family: 'Montserrat', sans-serif; 
  color: #1d1d1d; 
  font-weight: bold; 
  font-size: 40px; 
  word-spacing: 20px; 
  letter-spacing: 0.5px; 
}
<link href="https://fonts.googleapis.com/css?family=Montserrat&display=swap" rel="stylesheet"> 
<link href="https://fonts.googleapis.com/css?family=Montserrat&display=swap" rel="stylesheet"> 
 
 
 
<header> 
  <img src="logo.png" alt="" class="logo"> 
  <div class="menu"> 
    <a href="#" onMouseOut='getElementyById' (menu1).style.display="none" ; onMouseover="getElementyById" (menu1).style.display="block" ;> 
      <p class="text indent">HOME</p> 
    </a> 
    <a href="#" onMouseOut="getElementyById" (menu2).style.display='none' ; onmouseover="getElementyById" (menu2).style.display="block" ;> 
      <p class="text">ABOUT</p> 
    </a> 
    <a href="#" onMouseOut="getElementyById" (menu3).style.display='none' ; onmouseover="getElementyById" (menu2).style.display="block" ;> 
      <p class="text">WORK</p> 
    </a> 
    <a href="#" onMouseOut="getElementyById" (menu4).style.display='none' ; onmouseover="getElementyById" (menu2).style.display="block" ;> 
      <p class="text">PROCESS</p> 
    </a> 
    <a href="#" onMouseOut="getElementyById" (menu5).style.display='none' ; onmouseover="getElementyById" (menu2).style.display="block" ;> 
      <p class="text">SERVICES</p> 
    </a> 
    <a href="#" onMouseOut="getElementyById" (menu6).style.display='none' ; onmouseover="getElementyById" (menu2).style.display="block" ;> 
      <p class="text">TESTIMONIALS</p> 
    </a> 
    <a href="#" onMouseOut="getElementyById" (menu7).style.display='none' ; onmouseover="getElementyById" (menu2).style.display="block" ;> 
      <p class="text">CONTACT</p> 
    </a> 
  </div> 
</header> 
<div class="banner"> 
  <h2 class="web1">Web Design and Development</h2> 
  <p class="web2">We are a new design studio based in USA. We have over 20 years of combined experience, and know a thing or two about designing websites and mobile apps.</p> 
 
</div>

Answer 2
<link href="https://fonts.googleapis.com/css?family=Montserrat&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Montserrat&display=swap" rel="stylesheet">

<header>
  <img src="logo.png" alt="" class="logo">
  <div class="menu">
    <a href="#" onMouseOut='getElementyById' (menu1).style.display="none" ; onMouseover="getElementyById" (menu1).style.display="block" ;>
      <p class="text indent">HOME</p>
    </a>
    <a href="#" onMouseOut="getElementyById" (menu2).style.display='none' ; onmouseover="getElementyById" (menu2).style.display="block" ;>
      <p class="text">ABOUT</p>
    </a>
    <a href="#" onMouseOut="getElementyById" (menu3).style.display='none' ; onmouseover="getElementyById" (menu2).style.display="block" ;>
      <p class="text">WORK</p>
    </a>
    <a href="#" onMouseOut="getElementyById" (menu4).style.display='none' ; onmouseover="getElementyById" (menu2).style.display="block" ;>
      <p class="text">PROCESS</p>
    </a>
    <a href="#" onMouseOut="getElementyById" (menu5).style.display='none' ; onmouseover="getElementyById" (menu2).style.display="block" ;>
      <p class="text">SERVICES</p>
    </a>
    <a href="#" onMouseOut="getElementyById" (menu6).style.display='none' ; onmouseover="getElementyById" (menu2).style.display="block" ;>
      <p class="text">TESTIMONIALS</p>
    </a>
    <a href="#" onMouseOut="getElementyById" (menu7).style.display='none' ; onmouseover="getElementyById" (menu2).style.display="block" ;>
      <p class="text">CONTACT</p>
    </a>
  </div>
</header>
<div class="banner">
  <h2 class="web1">Web Design and Development</h2>
  <p class="web2">We are a new design studio based in USA. We have over 20 years of combined experience, and know a thing or two about designing websites and mobile apps.</p>
</div>
body {
  min-width: 1360px
}
header {
  min-height: 100%;
  height: 240px;
  background-color: #e9e9e9;
}
.logo {
  margin-top: 38px;
  margin-left: 100px;
}
.menu {
  margin-top: -30px;
}
.menu a {
  text-decoration: none;
  display: inline-block;
  color: #1d1d1d;
}
.text {
  font-family: 'Montserrat', sans-serif;
  margin-right: 50px;
  font-size: 12px;
  letter-spacing: 1px;
  word-spacing: 20px;
  font-weight: bolder;
  margin-right: 30px;
}
.indent {
  font-family: 'Montserrat', sans-serif;
  margin-right: 50px;
  font-size: 12px;
  letter-spacing: 1px;
  word-spacing: 20px;
  font-weight: bolder;
  margin-right: 40px;
  text-indent: 610px;
  margin-top: -30px;
  text-align: right;
}
.menu a:hover {
  text-decoration: none;
  color: lightskyblue;
}
.banner {
  background-color: lightpink;
  height: 420px;
  margin: none;
} html
.web1 {
  text-align: right;
  font-family: 'Montserrat', sans-serif;
  color: #1d1d1d;
  font-weight: bold;
  font-size: 40px;
  word-spacing: 20px;
  letter-spacing: 0.5px;
  margin:0px;
}

Просто обнули margin, у класса .web1.

READ ALSO
Парсинг сайта с помощью ehp

Парсинг сайта с помощью ehp

Как запарсить html с помощью библиотеки ehp,

128
route и параметры

route и параметры

У меня имеется метод который принимает 3 параметра

72
C# использование сторонних классов в проекте

C# использование сторонних классов в проекте

Нужно написать небольшой функционал по работе с жестким дискомСама суть программы не важна

101