+ 2

Help me ?

I am making a website about the earth. Everything seems to be okay but the space between the <div> element can't be fixed. See my website code in my codes . Then you will know. There is a horizontal gap between two div . How to fix it???

11th Jun 2018, 3:09 AM
Soubhagya Ranjan
Soubhagya Ranjan - avatar
3 Antworten
+ 8
Soubhagya Ranjan It appears the <p> is creating the space have you tried replacing it with a <div> ? after that I'm still trying to figure it out but adding a nice blue background color in the CSS body was an easy fix lol.
11th Jun 2018, 3:32 AM
bobbie
bobbie - avatar
+ 7
That is a common problem, but it is easily solved. Change the CSS rules of your div for something like this: div {      / * In your code you have a margin-bottom that can cause problems * /      margin: 0;      / * Changes the way in which the div are treated, in this way they respect the width, the height and the vertical margins */      display: inline-block;      / * Small Hack to keep the images centered * /      text-align: center; }
11th Jun 2018, 3:49 AM
Mickel
Mickel - avatar
+ 6
for a paragraph <p> tag browser automatically add some white space to display content decently... ref:-w3schools.com. so removing the <p> element may help..
11th Jun 2018, 3:41 AM
Sanjeev Kumar
Sanjeev Kumar - avatar