0

I'm using Bootstrap 4 masonry card layout for a project and inside that project I have a <select> that has custom styles. Part of the custom styles is a caret made with CSS using :after. Different browsers give me different results and I wanted to post it here in case someone had a solution. I'm not sure if this is a Bootstrap issue or a CSS spec issue so maybe someone could shed light there too.

  • Chrome Canary: everything looks fine
  • Chrome: the first column looks fine but any columns after the first look bad, unless you go to mobile (where I have it set to only 1 column), then it shows up fine there. It's only if there are more than 1 columns.
  • Firefox: everything is fine
  • Safari: the first column appears but any columns after the first one the caret AND the text don't appear.

Here's a Codepen Link: http://codepen.io/derekshull/pen/GZQaRY

.select-fancy {
  display: inline-block;
  border: 1px solid #bac2c6;
  position: relative;
  padding: 5px 10px;
  border-radius: 20px;
  width: 100%;
  overflow: hidden;
  color: #656565;
  box-shadow: inset 0 -2px 5px rgba(255, 255, 255, 0.4);
  background: #eee;
}

.select-fancy,
.select-fancy > * {
  cursor: pointer;
}

.select-fancy select {
  -moz-box-sizing: content-box;
  -webkit-box-sizing: content-box;
  box-sizing: content-box;
  background: transparent;
  border: 0;
  outline: 0;
  text-shadow: 1px 1px rgba(255, 255, 255, 0.7);
  font-size: 14px;
  width: calc(100% - 23px);
  -webkit-user-select: none;
  -moz-user-select: -moz-none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-appearance: none;
  -moz-appearance: radio-container;
  appearance: none;
  float: left;
  padding-left: 5px;
}

.select-fancy:after {
  content: '';
  display: block;
  white-space: nowrap;
  position: absolute;
  width: 0;
  height: 0;
  right: 11px;
  top: 50%;
  margin-top: -4px;
  border-width: 8px 6px;
  border-style: solid;
  pointer-events: none;
  border-color: #656565 transparent transparent transparent;
}

.select-fancy img {
  width: 17px;
  height: 17px;
  float: left;
  margin-top: 1px;
}

@media (max-width: 595px) {
 .card-columns {
  -webkit-column-count: 1;
        -moz-column-count: 1;
     column-count: 1;
 }
}

@media (min-width: 596px) and (max-width: 991px) {
 .card-columns {
  -webkit-column-count: 2;
        -moz-column-count: 2;
     column-count: 2;
 }
}
<section class="card-columns">
  <div class="card card-block">
      <h2 class="card-title"><a href="#">Card Title</a></h2>
      <p class="card-text"></p>
      <fieldset class="clearfix">
        <div class="select-fancy">
          <select class="urlSelect" data-projectid="12">
            <option value="Homepage">Homepage</option>
            <option value="Board Members">Board Members</option>
            <option value="Events">Events</option>
          </select>
        </div>
      </fieldset>
  </div>
  <div class="card card-block">
      <h2 class="card-title"><a href="#">Card Title</a></h2>
      <p class="card-text"></p>
      <fieldset class="clearfix">
        <div class="select-fancy">
          <select class="urlSelect" data-projectid="12">
            <option value="Homepage">Homepage</option>
            <option value="Board Members">Board Members</option>
            <option value="Events">Events</option>
          </select>
        </div>
      </fieldset>
  </div>
  <div class="card card-block">
      <h2 class="card-title"><a href="#">Card Title</a></h2>
      <p class="card-text"></p>
      <fieldset class="clearfix">
        <div class="select-fancy">
          <select class="urlSelect" data-projectid="12">
            <option value="Homepage">Homepage</option>
            <option value="Board Members">Board Members</option>
            <option value="Events">Events</option>
          </select>
        </div>
      </fieldset>
  </div>
</section>
Prifulnath
  • 463
  • 7
  • 24
derekshull
  • 305
  • 1
  • 2
  • 14

1 Answers1

0

Apparently removing overflow:hidden; fixes everything. Strange that it would do that. Still curious as to why that happened.

derekshull
  • 305
  • 1
  • 2
  • 14