1

I always wanted to know how to get css code from specified element of a web page Some web sites have a elements that I like and want to add into my localhost page, for example: menu bar.I use inspect element in Google Chrome and I know how to get html code but now css of the element. I looked at apple.com and I want to add that menu bar to my localhost sites.This is class for menu bar <div class="globalnav-wrapper">

Can you help me to get css code of this menu?My english is not got at all but I think you understand me.

Dusan
  • 47
  • 1
  • 1
  • 7
  • if the site author has restricted the display of css you cannot view the css.Or else you try it in firefox and see – Ninad Aug 23 '13 at 11:25
  • yes in firefox u can get the clear css – Ninad Aug 23 '13 at 11:27
  • @Ninad Do you have a link on how to restrict the display of CSS? I didn't think that was even possible. – Dre Jan 05 '17 at 11:58

3 Answers3

1

navigate to resources tab after pressing F12 in chrome and then expand directory tree there you will see css right click on it and choose save or save as

Deepak D
  • 103
  • 1
  • 12
0

Right click on the particular position and click "Inspect element" . In browser bottom you can see the selected div and right side can see the css. If you use firefox it will give more options

  globalnav-wrapper {
 position: absolute;
  z-index: 9998;
 top: 0;
 left: 50%;
margin: 18px 0 0 -512px;
width: 1024px;
}
neel
  • 5,123
  • 12
  • 47
  • 67
  • This is code I added http://pastebin.com/tYv2XSJg And this is what I get http://imageshack.us/f/407/g8xs.png/ To be sure, I made external css file – Dusan Aug 23 '13 at 11:54
  • coppy all the below css for ul , ul.. that will correct the menu – neel Aug 26 '13 at 04:09
0
  1. if you are using chrome:-

    $('div[class=globalnav-wrapper]')

  2. If you are using Firefox then download firebug and firepath and then click on inspect with firepath and select CSS in dropdown of element page and write:-

    div[class=globalnav-wrapper]

    firefox is easier and better than chrome in finding the element from the webpage.