Предотвращение свертывания значков внутри div внутри другого div - PullRequest
0 голосов
/ 13 февраля 2020

Таким образом, используя HTML, CSS и Bootstrap, у меня есть 4 иконки на левой стороне оболочки, где они организованы как квадрат. Но когда я изменяю размер окна, эти значки сворачиваются за консолью, которая у меня ниже. Как я могу предотвратить это (было бы неплохо держать кнопки в том же положении)?

Normal window, with buttons on square formation

After resize

Вот код для CSS и HTML

#designContainer {
  display: none;
  background-color: #fff;
  position: absolute;
  bottom: 40px;
  top: 120px;
  left: 10%;
  /*width of toolbar*/
  margin-left: 38px;
  /*margin of toolbar*/
  right: 20px;
  overflow: hidden;
  border: 1px solid #003399;
  /* border-top:3px solid #FFCC00; */
  z-index: 10;
  cursor: crosshair;
}

#toolsWrapper {
  display: none;
  background-color: #fff;
  position: absolute;
  bottom: 40px;
  top: 120px;
  left: 20px;
  width: 10%;
  overflow: hidden;
  z-index: 11;
  margin-bottom: 0;
}

#toolsWrapper label img {
  position: relative;
  width: 30px;
  height: auto;
  margin: 10px 0px;
  opacity: 0.3;
  transition: 0.2s;
}

#toolsWrapper [type=radio] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}


/* IMAGE STYLES */

#toolsWrapper [type=radio]+img {
  cursor: pointer;
}


/* CHECKED STYLES */

#toolsWrapper [type=radio]:checked+img {
  opacity: 1;
}

#toolsWrapper [type=radio]:checked+img:hover {
  opacity: 1;
}

#toolsWrapper [type=radio]+img:hover {
  opacity: 0.7;
}

#sideToolButtons {
  margin-bottom: 20px;
}

#sideToolButtons button {
  outline: none;
  width: 20px;
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

#sideToolButtons button:hover>img {
  opacity: 1;
}

#sideToolButtons button>img {
  width: 100%;
  height: 100%;
  opacity: 0.7;
}

#sideToolButtons .btn_disabled img {
  opacity: 0.2;
  cursor: default;
}

#sideToolButtons .btn_disabled:hover>img {
  opacity: 0.2;
  cursor: default;
}

#calcButton {
  position: absolute;
  bottom: 50px;
  width: 30px !important;
  right: 50%;
  margin-right: -10px !important;
  display: none;
}

#designConsole {
  width: 100%;
  position: absolute;
  bottom: 0;
  height: 60%;
  min-height: 180px;
  margin-bottom: 0;
}

#innerConsole {
  position: relative;
  color: #333;
  height: 100%;
  min-height: 40px;
  font-size: 9pt;
  border: #002774 1px solid;
  overflow: hidden;
  padding: 3px 6px;
}

#innerConsole:hover {
  overflow: auto;
}

#innerConsole>p {
  margin: 0;
  padding: 0 !important;
  text-align: left;
  margin-bottom: 5px !important;
}

.lastEntry {
  font-weight: bold;
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/css/bootstrap.min.css" rel="stylesheet"/>
<fieldset class="step">
  <legend id="stepTitle_2">Line Design</legend>
  <div id="stepDesc_2" class="txtbox">
    Make a sketch of the required line design. The composition and length of the channels are visible if you draw or adapt the line.
  </div>
  <div id="toolsWrapper" class="form-group">
    <label id='drawtoggle' class="col-md-3">
                                <input type="radio" id="penToggle" name="mouseToggle" value=0 checked>
                                <img src="./images/draw.png">
                            </label>
    <label id='cursortoggle' class="col-md-3">
                                <input type="radio" id="selToggle" name="mouseToggle" value=1>
                                <img src="./images/cursor.png">
                            </label>
    <div id="sideToolButtons" class="form-group">

      <button type="button" id="delButton" class="col-md-6" style="margin-left: 20px;">
                                    <img src="./images/trash.png" alt=""/>
                                </button>

      <button type="button" id="zoomFitButton" class="col-md-6" style="margin-left: 20px;">
                                    <img src="./images/zoom_fit.png" alt=""/>
                                </button>


    </div>
    <div id="designConsole" class="form-group">
      <!-- <div id="designDefinitions" class = "col-md-6"></div> -->
      <div id="innerConsole" class="col-md-12"></div>
    </div>
  </div>
  <div id="designContainer"></div>
</fieldset>

Спасибо.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...