Materialize: Gap between 2 <div> ?

Created on 31 Oct 2016  路  9Comments  路  Source: Dogfalo/materialize

I'm working at my website project and there's a gap ( or whitespace ? ) between 2 divs.
I already take a look at my code and i'm still confused how did this can be happening.

Screenshot

Could someone help me with this ? Any help appreciated, thanks 馃憤

All 9 comments

Could you please provide a codepen that reproduce the problem?

You could go to my respository and check my code here
Thanks 馃榾

Try
'* {
margin: 0;
padding: 0;
}'

This is me _guessing_, but If that div above "Tentag section" is using class row the space is most likely due to the margin-bottom: 15px which is set to the class .row . You can be easily override it by creating a class .className { margin-bottom: 0!important; } and setting it to the div <div class="row className">.

However, it's hard to tell what the problem is without seeing it live/the code. Try right clicking the white space and click inspect element you should see whats giving you the that space by hovering over the div.

If not, like @kmmbvnr said. Make a codepen of the problem.

@kmmbvnr , sorry for making you dissapointed. here's the codepen
@lpq66 Thanks for the suggestion! I Already tried it and still, there's a gap between them
@GorgonsMaze, i dont use row class, could you check my code ? codepen

@iqbalaqaba The problem is your .jumbotron class has a margin-bottom: 30px;

.jumbotron {
    padding-top: 30px;
    padding-bottom: 30px;
    margin-bottom: 30px;    /* Here */
    color: inherit;
    background-color: #eee;
}

Just get rid of it, and that will get rid of the space.

Just override the css. BTW the margin bottom is on a bootstrap class and we don't recommend using both css frameworks together.

@GorgonsMaze Thanks a lot !! it's worked now.
@acburst thanks 馃榾

Anyone that comes across this. I have found that when using materialize:

Inspecting the elements you will so no padding or margin on the element in question. The containing elements do not seem to overflow, but they still do.
However, using margin inside of the element with a gap can cause this behavior.
For instance I had:

<div id="top" style="margin-bottom:0 !important">
  <form style="margin-bottom:20px"></form>
</div>
<div id="bottom" style="margin-top:0 !important">
  <h4 style="margin-top:20px">Foo title</h4>
</div>

So I had a 40 px margin between the two divs and could not for the lift of me figure it out (for five minutes).

So if you come across this, check your containing divs (near the edges)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hartwork picture hartwork  路  3Comments

SoproniOli713 picture SoproniOli713  路  3Comments

bradley-varol picture bradley-varol  路  3Comments

acierpinski picture acierpinski  路  3Comments

artur99 picture artur99  路  3Comments