1

I'm using a modal as an image viewer from materialize CSS http://materializecss.com/. When a user clicks a button, the modal opens. The modal has an image element within it. I've set both the height and the width to 100% but I cannot figure out why there is still a line at the bottom that my image is not covering.enter image description here

<div id="modal1" class="modal">
    <a id="closeIcon"><i class="fa fa-times-circle fa-2x"></i></a>
    <img class="responsive-img" id="roomImage" src="">
</div>

#roomImage{
  width: 100% !important;
  height: 100% !important;
}
claudios
  • 6,588
  • 8
  • 47
  • 90
unconditionalcoder
  • 723
  • 1
  • 13
  • 25

2 Answers2

0

Try to add this css inside your custom sytlesheet. This should work as expected.

CSS

.modal {
  background-color: transparent;
  padding: 0;
  max-height: 100%;
  width: 55%;
  margin: auto;
  overflow-y: hidden;
  border-radius: 2px;
}

.z-depth-4, .modal {
  box-shadow: none;
}
claudios
  • 6,588
  • 8
  • 47
  • 90
0

Here's something I like to always use to start a website. It's a simple CSS snipet, but it works wonders.

body, h1, h2, h3, h4, h5, h6, p, blockquote, pre, hr, dl, dd, ol, ul, figure {
    margin: 0;
    padding: 0;
}

I first saw this in Jekyll. Although it seems simple (and it is) it'll reset all your basic elements so that width: 100% and height: 100% will actually do what they're supposed to do.

Zachary Vincze
  • 427
  • 7
  • 24