官术网_书友最值得收藏!

  • Mastering CSS
  • Rich Finelli
  • 248字
  • 2021-07-08 09:45:51

Changing CSS inside the inspector

On the right-hand side of the inspector, you will see all your styles for whatever element you have highlighted in the DOM. You can even click on any of those properties or values and change them. So if you click on 26px, next to font-size, you can increase it to whatever you want. This is updated immediately in the browser, which is very cool:

You can even uncheck certain properties and see that change immediately. So, as you can see in the next screenshot, if you click on the h2 element in the DOM and then uncheck color and margin bottom on the right-hand side, this change to the h2 element takes immediate effect. Simply recheck them to add them back:

If you click on the last element—in this case, margin-bottom and hit Tab, it will allow you to type in a new property and value. So add margin-left of -40px and see what it looks like; this moves this h2 over 40px to the left:

Now these aren't permanent changes. As soon as the browser is refreshed, these styles will disappear; however, you can copy this rule set and paste it into your code if you want to keep these changes we're experimenting with. It even tells us where this rule set is currently located in the style sheet-line 86. If you hover your mouse over that, it will tell you exactly where that file is in your website's folder:

主站蜘蛛池模板: 乐山市| 依安县| 贵溪市| 建昌县| 普宁市| 辽中县| 东安县| 丹寨县| 九寨沟县| 大宁县| 驻马店市| 资兴市| 唐河县| 萝北县| 宁夏| 上虞市| 邹平县| 额济纳旗| 湘潭县| 海丰县| 乾安县| 唐山市| 石景山区| 乌拉特前旗| 茌平县| 丰台区| 隆尧县| 长葛市| 云和县| 九寨沟县| 达州市| 宁武县| 聂拉木县| 绥棱县| 略阳县| 黑龙江省| 苏尼特左旗| 屯留县| 青神县| 玉龙| 翼城县|