# 大图上传中图片缩放的CSS问题

**URL:** <https://meta.discourse.org/t/css-problem-with-image-resizing-on-large-image-uploads/56947>\
**Category:** Support\
**Created:** [2017 年2 月 5 日 16:07 UTC](https://meta.discourse.org/t/css-problem-with-image-resizing-on-large-image-uploads/56947 "2017-02-05T16:07:10Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

作者： ![mitchellk](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mitchellk/32/120419_2.png) [@mitchellk](https://meta.discourse.org/u/mitchellk)\
发布日期： [2017 年2 月 5 日 16:07 UTC](https://meta.discourse.org/t/css-problem-with-image-resizing-on-large-image-uploads/56947/1 "2017-02-05T16:07:10Z")

</div>

I had this fixed but then broke it somehow, can someone perhaps see if they can spot where in CSS I can get images uploaded that are over 1400px in width to auto size and not be cut off.

I had this in CSS which worked 100%

```
body .cooked img:not(.thumbnail) {
    width: auto;
    height: auto;
    display: block;
    max-width: 900px;
}

```

until I changed it to the following (adding .emoji) as emojis were displaying big. That worked for fixing the big emoji’s but broke the image resizing of large images again.

```
body .cooked img:not(.thumbnail .emoji) {
    width: auto;
    height: auto;
    display: block;
    max-width: 900px;
    max-height: 900px;
}

```

If I inspect the element in Chrome it shows that this is where it is getting it’s CSS from

```
#reply-control .d-editor-preview img:not(.thumbnail), .cooked img:not(.thumbnail) {
max-width: 1200px;
max-height: 1200px;
}

```

However trying to override that with

```
body #reply-control .d-editor-preview img:not(.thumbnail .emoji), .cooked img:not(.thumbnail .emoji) {
    width: auto;
    height: auto;
    display: block;
    max-width: 900px;
    max-height: 900px;
}

```

has no effect. I’m a bit stumped now.

---

_[View the full topic](https://meta.discourse.org/t/css-problem-with-image-resizing-on-large-image-uploads/56947)._
