动态样式如何写(为解决不同页面分辨率问题) var aa=screen.width;获取了屏幕的宽 根据这个值 想用switch去对应加载css但是不知道如何写 求教 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 var style = document.createElement('link');style.type = "text/css";style.rel = "stylesheet";style.href = 'a.css';document.getElementsByTagName('head')[0].appendChild(style) <!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=gb2312" /><title>无标题文档</title><script type="text/javascript">var aa=screen.width;var style = document.createElement('link');style.type = "text/css";style.rel = "stylesheet";style.href = 'a.css';document.getElementsByTagName('head')[0].appendChild(style)break;</script></head><body><div class="a"></div></body></html>1280.css文件如下 都是放在桌面的文件.a{width:500px;height:500px;background-color:#999900;} style.href = '1280.css';我记得你好像之前问过,你看你之前的帖子 我给你回复了。 那个是在web(css)板块的 改了 但是无果如果不忙,希望可以复制一下代码帮忙看一下 谢 搞定了 有需要类似帮助的同学去看我另一个帖子吧 也是【MuBeiBei】帮忙的 哈哈 多个图片的高度如何赋值给表单呢? 火狐读 xml 出问题 iframe的使用 cookie 修改保存路径?? 请问如何实现类似mapbar的地图技术?急!!!大虾赐教!! js如何在子页面里调用checkboxlist下的值返回到父页面中??(新手问题) 高人请解释一下,谢过! navigator.cookenabled能否准确判断浏览器是否接受cookie? 高手请看:表格的终极问题 简单的小问题!如何调用服务器的系统日期? Jquey未定义 你们是怎么做的?关于限制前台页面输入字符串长度
style.type = "text/css";
style.rel = "stylesheet";
style.href = 'a.css';document.getElementsByTagName('head')[0].appendChild(style)
<!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=gb2312" />
<title>无标题文档</title>
<script type="text/javascript">
var a
a=screen.width;var style = document.createElement('link');
style.type = "text/css";
style.rel = "stylesheet";
style.href = 'a.css';document.getElementsByTagName('head')[0].appendChild(style)
break;
</script>
</head><body>
<div class="a"></div>
</body>
</html>1280.css文件如下 都是放在桌面的文件.a{
width:500px;
height:500px;
background-color:#999900;}