Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

HTML & CSS -Div

Hi I’ve just started learning HTML & CSS and I’m doing some exercises, I’m wondering how can I remove the blank space between the 2 pictures (that thin white line)

Here’s a picture for referenceenter image description here

Here’s the code

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel


    <div class="content">
      <h1>Plan Your Visit</h1>
      <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed. Duis aute irure dolor in reprehenderit. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed. Duis aute irure dolor in reprehenderit.  Duis aute irure dolor in reprehenderit consectetur adipiscing elit, sed. </p>
      <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed. Duis aute irure dolor in reprehenderit.  Duis aute irure dolor in reprehenderit consectetur adipiscing elit, sed.</p>
      <button class="btns">More</button>
    </div>
    <div>
      <img src="photo2.jpeg">
    </div>
    
   
    <div class="content">
      <h1>Plan Your Visit</h1>
      <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed. Duis aute irure dolor in reprehenderit. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed. Duis aute irure dolor in reprehenderit.  Duis aute irure dolor in reprehenderit consectetur adipiscing elit, sed. </p>
      <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed. Duis aute irure dolor in reprehenderit.  Duis aute irure dolor in reprehenderit consectetur adipiscing elit, sed.</p>
      <button class="btns">More</button>
    </div>
    <div>
      <img src="photo2.jpeg">
    </div>````
CSS

body{
  background-color: white;
  font-family: Verdana, Geneva, Tahoma, sans-serif;
}
.content{

  color: black;
  margin-top: 100px;
  margin-left: 30px;
  padding-right: 200px;
  text-align: justify;
}
h1{
  font-size: 50px;
}
p{
  margin-top: 10px;
  float:left
}
main{
  display: grid;
  grid-template-columns: 1fr 1fr;
}
img{
  max-width: 100%;
  margin-top: 0px;
  margin-left: auto;
  width: auto;
}````

>Solution :

It probably has to do with the height of your image.
Try adding:

  height: 100%;

to the img css

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading