Apply size in a textarea, unless it has the "rows"

1

I have a textarea that is formatted with the following rule:

.wm-form textarea{
  min-height:100px;
  resize: vertical;
  width:100%;
  border-radius:4px;
  border:1px solid #ccc;
}
<form class="wm-form">
  <textarea></textarea>
</form>

But I would like that when my textarea has the rows attribute (which would affect the textarea size), the size set to min-height is applied.

How to do this?

    
asked by anonymous 01.11.2016 / 18:17

1 answer

4

use not to make a selection for the textarea that you do not have the rows attribute:

.wm-form textarea {
  resize: vertical;
  border-radius:4px;
  border:1px solid #ccc;
  width:100%
}

.wm-form textarea:not([rows]){
  min-height:100px;
}
<form class="wm-form">
  <textarea></textarea>
</form>

<form class="wm-form">
  <textarea rows='10'></textarea>
</form>
    
01.11.2016 / 18:37