Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
416 views
in Technique[技术] by (71.8m points)

html - Resizing textarea jumps when moving the cursor to the right

I'm trying to make CSS columns that consist of only textareas.

The textarea is currently set to resize: vertical. My problem is that if the user tries to resize the textarea horizontally (move the cursor to the right while dragging), the textarea will jump/expand to its max height.

https://jsfiddle.net/5Lqg82jx/

body {
  font-size: 1.3rem;
  line-height: 1.65;
  font-family: 'Multi', sans-serif;
  color: #1E1E24;
  background-color: #FFF8F0;
  margin: 2em;
}

h1 {
  font-size: 2rem;
  color: #92140C;
  font-weight: 900;
  display: inline-block;
}

header {
  line-height: 70px;
  color: rgb(225, 236, 231);
  padding: 0 70px;
}

section {
  padding: 40px;
}

textarea {
  resize: vertical;
  max-height: 100px;
  min-height: 50px;
  width: 100%;
}

.wrap {
  -webkit-columns: 100px;
  -moz-columns: 100px;
  columns: 100px;
  -webkit-column-gap: 40px;
  -moz-column-gap: 40px;
  column-gap: 40px;
  page-break-inside: avoid;
}
<div class='textarea-columns'>
  <header>
    <h1>CSS Columns</h1>
  </header>
  <section>
    <div class="wrap">
      <label>
        <textarea>Text Area 1</textarea>
        <textarea>Text Area 2</textarea>
        <textarea>Text Area 3</textarea>
        <textarea>Text Area 4</textarea>
        <textarea>Text Area 5</textarea>
        <textarea>Text Area 6</textarea>
      </label>
    </div>
  </section>
</div>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...