0

nowrap for my textarea isnt working. Could someone please tell me what am I doing wrong? Here is my code from .php file:

<div class="uprava">
<input id="inputBox" type="textarea" name="obsah" value="<?php echo $obsah; ?>"/>
</div>
<script>document.getElementById("inputBox").style.whiteSpace = "nowrap";</script>

and here it is from CSS:

#inputBox {
    height: 184px;
    font-size: 16px;
    width:auto;
    min-width: 100%;
    margin-bottom: 10px;
    -webkit-appearance: none;
    background: #fff;
    border: 1px solid #d9d9d9;
    border-top: 1px solid #c0c0c0;
    padding: 0 8px;
    box-sizing: border-box;
    -moz-box-sizing: border-box;
}
Dedo
  • 1
  • 3

1 Answers1

0

You just need to add an id markup to the input and simply add the nowrap property with a simple one-line script like how I did here : http://jsfiddle.net/9v2g93dc/2/

.uprava input[type=textarea] {height: 184px; font-size: 16px; width: 100%; margin-bottom: 10px; -webkit-appearance: none; background: #fff; border: 1px solid #d9d9d9; border-top: 1px solid #c0c0c0; /* border-radius: 2px; */  padding: 0 8px; box-sizing: border-box; -moz-box-sizing: border-box;

}

AndrewL64
  • 15,794
  • 8
  • 47
  • 79