Look with CSS is possible yes... first remember that mediated in % of a child is related to width and height of the father.
So vc ve has a parent container 200px high and 200px wide, and the child is 50% wide and 50% high, this child is actually going to be 100px high and 100% high.
Having this concept in mind see that it is possible to have a textarea
in % that accompanies the father’s size
Follow the image code above. In case the textaarea
is the direct son of body
, which is 100% window height and width.
Show on page all tb to see the textarea
resize
html, body {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
}
#texto {
height: 50%;
width: 50%;
}
<textarea name="" id="texto" value="">Lorem ipsum dolor sit amet consectetur adipisicing elit. Quaerat, consequatur accusamus provident quo nisi quae, vero unde, corporis sint atque fuga porro. Quae eligendi voluptates incidunt neque, accusantium labore inventore.</textarea>
I would need to call a function with this code in p:dialog?
– Juliana Marques
Not necessarily, the activation of the resize event already executes the entire block necessary for the actions to be done, but it is a good practice that you put all the code inside a Closure yes and then run it in the page load.
– cpurificacao
Thanks for the explanations @Apolo Master, I have little knowledge in Javascript
– Juliana Marques