js获取外联样式

 时间:2024-10-14 11:27:33

1、<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN媪青怍牙" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>访问外部样式表</title><script type="text/javascript"> function changeBackgroundColor() { //这儿如何写访问外部样式表中代码(比如:.special中的border值) }</script><link href="default.css" rel="stylesheet" type="text/css" /></head><body><div id="div1" class="special"></div><input type="button" value="Change Background Color" onclick="changeBackgroundColor()" /></body></html>

2、使用window.getComputedStyle('')

3、window也可以去掉

  • CSS中有哪些常用选择器?
  • java编程:判断某年是否为闰年
  • CSS3教程 为元素添加圆角边框
  • css滤镜实现鼠标悬停图片变黑白(灰色)
  • navicat的应用方法
  • 热门搜索
    静寂的近义词 手机反应慢怎么办 定期存款怎么存 活动主题怎么写 娘惹博物馆 怎么看显存 健身房怎么练腹肌 飞机头怎么吹 哺乳期感冒吃什么药 武汉科技大学怎么样