0

I am debugging a web portal out of a Java project. In the resulting jsp page, a div is always not shown, the reason is because there is a "display:none" being set for it:

 <div class="settings_nav" style="display: none;">

  </div>

In the debug mode of the Chrome browser, there is a "Styles" section describes this as:

 element.style {
 display: none;
 }

Interestingly, this style information is not associated with any CSS stylesheets in Chrome debug mode, I searched through the CSS stylesheet set, there is still not hit.

Could experts give me some hint on where is the best place to find this style definition? Thanks.

Thirumalai murugan
  • 5,698
  • 8
  • 32
  • 54
Kevin
  • 6,711
  • 16
  • 60
  • 107

3 Answers3

1

It's not coming from a style sheet since it's an inline style on the div. Inline styles override values from style sheets.

Could have been added through JavaScript or server side code

TGH
  • 38,769
  • 12
  • 102
  • 135
  • since it is such a huge project, do you think it makes sense to search the "javascript" subfolder using keyword "settings_nav"? – Kevin Jun 25 '13 at 01:20
  • Yes, if it's using JQuery to hide it, you might find something like $(".settings_nav").hide() – TGH Jun 25 '13 at 01:21
  • @Kevin search for single quotes too: `$('.settings_nav').hide()` or better yet, just go through all instances of `.hide()` and possibly `.css(` and others like them. – smilebomb Jun 25 '13 at 01:31
1

element.style refers to dynamically added styles; that is, as others have pointed out, added by javascript. I would look through your js files. Your best bet is to search your js directory for keywords that are involved in changing CSS. I can almost guarantee that the word 'display' is used somewhere (unless you are using jquery) and if you are really lucky maybe you'll only get a couple hits on that search term.

smilebomb
  • 5,123
  • 8
  • 49
  • 81
0

There are a few different ways in which you might see the styles applied and you can check it through the dev tools.

  1. Inline style
  2. User-agent stylesheet
  3. Styles defined in a stylesheet
  4. Using Javascript
Yashu Mittal
  • 1,478
  • 3
  • 14
  • 32