Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove unwanted space between these two DIVs?

I have two div with 100 % width I have problem I am getting space between div I am using bootstrap and tried different CSS properties but nothing happens I want 0 margin between them can't figure it out how its can be done

enter image description here

My Code:

          .sec-one {
            height: 200px;
            width: 100%;
            background-color: pink;
          }
          .sec-two {
            height: 200px;
            width: 100%;
            background-color: red;
            text-align: center;
          }
          #header h1 a {
            display: inline-block;
            text-decoration: none;
            font-size: 1.8em;
            color: white;
            margin-top: 90px;
          }
<html>

<head>
  <link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
</head>

<body>

  <div class="sec-one">

  </div>

  <div class="sec-two">

    <div id="header">
      <h1><strong><a href="">A Heading</a></strong></h1>
    </div>

  </div>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
</body>

</html>
like image 887
Raza Poonja Avatar asked Sep 04 '25 04:09

Raza Poonja


1 Answers

Just insert h1 {margin:0px} in your stylesheet and it will work.

In my example the property is sitting at the top.

Example

like image 91
Antonio Smoljan Avatar answered Sep 06 '25 11:09

Antonio Smoljan