Comments on: resize https://css-tricks.com Tips, Tricks, and Techniques on using Cascading Style Sheets. Thu, 09 Sep 2021 05:49:56 +0000 hourly 1 https://wordpress.org/?v=6.6.1 By: Amrit kaur https://css-tricks.com/almanac/properties/r/resize/#comment-1782233 Thu, 09 Sep 2021 05:49:56 +0000 http://css-tricks.com/?page_id=14099#comment-1782233 resize property defined very well!

]]>
By: Zoink https://css-tricks.com/almanac/properties/r/resize/#comment-1757446 Wed, 03 Jun 2020 13:32:16 +0000 http://css-tricks.com/?page_id=14099#comment-1757446 Is there possible way we could customize that resize in dragging the edges of the element?

]]>
By: Zach Bjornson https://css-tricks.com/almanac/properties/r/resize/#comment-1664729 Fri, 15 Feb 2019 20:53:20 +0000 http://css-tricks.com/?page_id=14099#comment-1664729 Update/correction: Chrome 61+ (no longer a WebKit browser) does allow shrinking. https://bugs.chromium.org/p/chromium/issues/detail?id=94583

]]>
By: Liam Mitchell https://css-tricks.com/almanac/properties/r/resize/#comment-1612729 Fri, 27 Oct 2017 17:28:21 +0000 http://css-tricks.com/?page_id=14099#comment-1612729 Could resize allow for specifying a corner or edge for it to be applied on?
As well as styling of the icon/area.

Example: A absolute bottom left area might want to resize from top edge vertically.

]]>
By: Mike C https://css-tricks.com/almanac/properties/r/resize/#comment-1611368 Fri, 25 Aug 2017 21:13:04 +0000 http://css-tricks.com/?page_id=14099#comment-1611368 In reply to harpreet bhatia.

I know this is a bit late, but window is the only part of the DOM that fires the onresize event

]]>
By: Laurens Maneschijn https://css-tricks.com/almanac/properties/r/resize/#comment-1610395 Wed, 19 Jul 2017 09:51:46 +0000 http://css-tricks.com/?page_id=14099#comment-1610395 Late reply, but perhaps it still helps someone:

I found the webkit restriction on not being able to downsize an element quite frustrating, and found adding :active{ width:0; height: 0; }helps.

Recommended:

  • add width, height for a sensible starting size.
  • add min-width, min-height for a sensible min size, so you don’t end up with a 0x0 box that is hard to enlarge again.
  • add max-width, max-height for a sensible max size, so you don’t end up dragging the corner outside your window.

Notes:

  • I’m not quite sure how this makes it work.
  • It seems to be a bit of a hack and probably wise not to rely on it on production websites.
  • It seems to work on browsers that limit the min size to initial size (WebKit e.g. Chrome).
  • It has side effects: if you click the element it can shrink to zero size (temporarily).
  • The above is more apparent on mobile devices and browsers that do not support resize,
    and might stay in that state untill clicking or tapping outside the element.
  • It is probably wise to use mechanisms to limit it to webkit browsers.

Test here: https://jsfiddle.net/ElMoonLite/771Ln5vu/

Complete example:

.resize {
  resize: both;
  overflow: hidden;
/* optional:
  width:  <some sensible starting size>;
  height: <some sensible starting size>;
  min-width:  <some sensible min size>;
  min-height: <some sensible min size>;
  max-width:  <some sensible max size>;
  max-height: <some sensible max size>;
*/
}
.resize:active {
  width: 0;
  height: 0;
}
]]>
By: Adam Taylor https://css-tricks.com/almanac/properties/r/resize/#comment-1596203 Thu, 30 Jul 2015 07:54:10 +0000 http://css-tricks.com/?page_id=14099#comment-1596203 Might be worth adding that max-width and max-height can be used to limit the amount the element can be resized. Stops it being too large and breaking out of its parent for example.

]]>
By: channu yatnur https://css-tricks.com/almanac/properties/r/resize/#comment-1592237 Fri, 30 Jan 2015 06:22:28 +0000 http://css-tricks.com/?page_id=14099#comment-1592237 Hi,
css resize:both for iframe is not working in IE and firefox but working in chrome very nicely…plz give me suggestions

]]>
By: Josh Harrington https://css-tricks.com/almanac/properties/r/resize/#comment-1585635 Wed, 01 Oct 2014 18:37:55 +0000 http://css-tricks.com/?page_id=14099#comment-1585635 Hey Chris,

You’re always my first resource for everything CSS, cheers for all the help over the years!

Just wanted to expand upon your point about the weirdness across Chrome compared with Firefox. I assumed that you’d be able to assign a min-width, a width and a max-width on the resizable element, with the loaded width being taken by the default width. Then the user should be able to change the width between the min and max widths. This seems to be the case in Firefox but not in Chrome.

Any ideas if this is likely to change to implement the Firefox behaviour in Chrome also?

Thanks,
Josh

]]>
By: harpreet bhatia https://css-tricks.com/almanac/properties/r/resize/#comment-1100354 Mon, 20 Jan 2014 13:54:51 +0000 http://css-tricks.com/?page_id=14099#comment-1100354 Does this can also be subjected to onresize event??

]]>
By: Fernando https://css-tricks.com/almanac/properties/r/resize/#comment-288462 Wed, 20 Feb 2013 20:28:34 +0000 http://css-tricks.com/?page_id=14099#comment-288462 Hey, dude. I’m very grateful for all tricks you’ve shared.

Muchas gracias!

]]>