# 针对 Ember CSS ID 会导致奇怪的行为

**URL:** <https://meta.discourse.org/t/targeting-ember-css-ids-results-in-weird-behavior/60628>\
**Category:** Support\
**Created:** [2017年四月8日 04:04 UTC](https://meta.discourse.org/t/targeting-ember-css-ids-results-in-weird-behavior/60628 "2017-04-08T04:04:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![LilTrashPanda](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/liltrashpanda/32/62053_2.png) [@LilTrashPanda](https://meta.discourse.org/u/LilTrashPanda)\
**Post date:** [2017年四月8日 04:04 UTC](https://meta.discourse.org/t/targeting-ember-css-ids-results-in-weird-behavior/60628/1 "2017-04-08T04:04:27Z")

</div>

When navigating directly to a sub-category page via URL on Firefox or Edge (doesn’t seem to impact Chrome), it results in a broken page. Example URL: [http://talk.readyatdawn.com/c/deformers/techsupport](http://talk.readyatdawn.com/c/deformers/techsupport)

 ![](https://global.discourse-cdn.com/meta/original/3X/8/d/8d5d1ceccf5b112a96a0a461b5c1d4f1285b6591.png)

However, when navigating to that same page from the Category page first, it seems to work fine. Example URL: [http://talk.readyatdawn.com/c/deformers](http://talk.readyatdawn.com/c/deformers) (now click on “Tech Support” and view the page).

 ![](https://global.discourse-cdn.com/meta/original/3X/9/c/9c638ce8671b3bbdac024538d2f415f0358bbc25.png)

Not sure if this is something I’ve screwed up in CSS (if it is, any pointers on how to fix this would be super helpful).

Thanks!

---

<div class="post-metadata">

**Author:** ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)\
**Post date:** [2017年四月8日 11:50 UTC](https://meta.discourse.org/t/targeting-ember-css-ids-results-in-weird-behavior/60628/2 "2017-04-08T11:50:58Z")

</div>

You need to delete this CSS rule

```plaintext
body.category-deformers-techsupport #ember960

```

As it is overriding the background color to be `#f4f4f4`, which is white-washing it

Also, you should not use any `#ember...` ids in your CSS rules, as those IDs are not guaranteed. Thus why it only happens when directly visiting the page versus navigating to it.

---

<div class="post-metadata">

**Author:** ![LilTrashPanda](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/liltrashpanda/32/62053_2.png) [@LilTrashPanda](https://meta.discourse.org/u/LilTrashPanda)\
**Post date:** [2017年四月9日 00:03 UTC](https://meta.discourse.org/t/targeting-ember-css-ids-results-in-weird-behavior/60628/3 "2017-04-09T00:03:24Z")

</div>

Perfect, thanks for the help!

---

<div class="post-metadata">

**Author:** ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)\
**Post date:** [2024年六月8日 12:44 UTC](https://meta.discourse.org/t/targeting-ember-css-ids-results-in-weird-behavior/60628/4 "2024-06-08T12:44:52Z")

</div>

此主题已在 2618 天后自动关闭。不再允许回复。
