Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![Sam Hayward](https://uploads.teamtreehouse.com/production/profile-photos/121742/micro_profile.jpg)
Sam Hayward
11,673 PointsJquery adding inline styles?
Hey ^ ^ I'm working on my own site and trying to use Jquery to make a menu for mobile view appear and disappear. For some reason, jquery adds its own inline styles to the menu like 'display:block' Its really weird, does anyone have a clue why? Please help =) thanks
4 Answers
![Jeffrey Smith](https://secure.gravatar.com/avatar/27878f6a46e16c9e7da6f51a49cf72fa?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Jeffrey Smith
Courses Plus Student 15,508 PointsIt's being added as inline style because that is one of the most specific types of styling in CSS so it overrides almost anything else.
jQuery will add 'display:block' if you are using the show() method. The show method restores the hidden element back to its initial state— so if you had an element that was initially set to 'display:inline' and then it was hidden, the show() method would have it display inline again.
![Nicholas Olsen](https://uploads.teamtreehouse.com/production/profile-photos/1046632/micro_profilepic.jpg)
Nicholas Olsen
Front End Web Development Techdegree Student 19,342 PointsI'm not sure how similar it is to the problem you're experiencing but I had a similar problem when I was working on this menu.
jQuery's animate() function adds inline styles to the menu so I had to use the animate function to reset the inline styles back to what I wanted them to be.
As Josh said, if you have code please post it.
![Josh Hicks](https://uploads.teamtreehouse.com/production/profile-photos/126328/micro_tiger_blood.png)
Josh Hicks
14,146 PointsDo you have any code samples?
![Sam Hayward](https://uploads.teamtreehouse.com/production/profile-photos/121742/micro_profile.jpg)
Sam Hayward
11,673 PointsSorry for the late reply i've been really busy! It was really simple just using .show() and .hide() on a div. Now i realise i wanted .toggle() Just happy that it's something that's supposed to happen Thanks guys =)