First, using resize attribute in CSS has not had support in IE except for all browsers. The textarea is first selected and this method is used to apply an event handler on the selected element. The key is to use height:auto to override any height= attribute already present on the image. First, using resize attribute in CSS has not had support in IE except for all browsers. Agar tidak bingung, sebaiknya Anda mengenal dulu beberapa istilah untuk belajar HTML:. I didnt know the height of the content and the textarea element doesnt resize naturally like other HTML elements, so I needed to update the height of the element with JavaScript each time the content changed. Elemen: keseluruhan kode yang terdiri dari tag pembuka (< >) hingga tag penutup (/< >). img { max-width:100%; height:auto; } Width can also be used instead of max-width if desired. img[src$="#fit"] { width: 100vw; height: auto; max-width: none; max-height: 100vh; object-fit: contain; } width: 100vw - image width will be 100% of view port. They'll automatically take up all the available space in their container. The user cannot resize the element: Play it both: The user can resize both the height and width of the element: Play it horizontal: The user can resize the width of the element: Play it vertical: The user can resize the height of the element: Play it initial: Sets this property to its default value. The problem. Following up to my previous question (Add a scrollbar to a