# 根据用户登录状态控制 CSS

**URL:** https://meta.discourse.org/t/control-css-based-on-users-logged-in-state/116570
**Category:** Support
**Created:** [2019年五月1日 13:45 UTC](https://meta.discourse.org/t/control-css-based-on-users-logged-in-state/116570 "2019-05-01T13:45:00Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![alexs](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alexs/32/139956_2.png) [@alexs](https://meta.discourse.org/u/alexs)
#### Post date: [2019年五月1日 13:45 UTC](https://meta.discourse.org/t/control-css-based-on-users-logged-in-state/116570/1 "2019-05-01T13:45:00Z")

</div>

I’m trying to add a link to our site’s menubar, next to the search icon.

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

It’s positioned correctly when a user’s signed in but overlaps the login / signup buttons if someone’s not signed in.

Is it possible to set the CSS / html to only be displayed for people who have signed in?

---

<div class="post-metadata">

### Author: ![schleifer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/schleifer/32/86416_2.png) [@schleifer](https://meta.discourse.org/u/schleifer)
#### Post date: [2019年五月1日 14:04 UTC](https://meta.discourse.org/t/control-css-based-on-users-logged-in-state/116570/2 "2019-05-01T14:04:03Z")

</div>

This does not answer the question in the title, but have you seen the theme component?

> [@Custom Header Links](https://meta.discourse.org/t/custom-header-links/90588):
>
> discourse2Summary Custom Header Links allows you to easily add custom text-based links to the header.eyeglassesPreview [Preview on Discourse Theme Creator](https://discourse.theme-creator.io/theme/Discourse/custom-header-links)hammer_and_wrenchRepository Link [GitHub - discourse/discourse-custom-header-links · GitHub](https://github.com/discourse/discourse-custom-header-links)open_bookNew to Discourse Themes? [Beginner’s guide to using Discourse Themes](https://meta.discourse.org/t/beginners-guide-to-using-discourse-themes/91966) Install this theme component Features Desktop Mobile (due to very limited space, adding more than one link on mo…

---

<div class="post-metadata">

### Author: ![alexs](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alexs/32/139956_2.png) [@alexs](https://meta.discourse.org/u/alexs)
#### Post date: [2019年五月1日 14:05 UTC](https://meta.discourse.org/t/control-css-based-on-users-logged-in-state/116570/3 "2019-05-01T14:05:17Z")

</div>

No, thanks a lot, I guess that’ll do the job for me 😀

**Edit -** it did.

---

<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: [2022年八月20日 09:09 UTC](https://meta.discourse.org/t/control-css-based-on-users-logged-in-state/116570/5 "2022-08-20T09:09:35Z")

</div>


