小编Noj*_*jan的帖子

包含图像的锚标签上没有边框

我的文档中有一个锚标记的全局规则:

a,a:hover {border-bottom: 1px solid #ccc;}
Run Code Online (Sandbox Code Playgroud)

但是边框在图像上看起来并不好看.我很好奇是否有办法删除包含仅使用纯CSS的图像的锚标签的边框?

css anchor image border

9
推荐指数
1
解决办法
7995
查看次数

通过JavaScript更改正文标记样式

我正在尝试编写一个脚本来改变页面的宽度,考虑用户的客户端宽度.它是这样的:

function adjustWidth() { 
    width = 0;
    if (window.innerHeight) {
        width = window.innerWidth;
    } else if (document.documentElement && document.documentElement.clientHeight) {
        width = document.documentElement.clientWidth;
    } else if (document.body) {
        width = document.body.clientWidth;
    }
    if (width < 1152) {
        document.getElementsByTagName("body").style.width="950px";
    }
    if (width >= 1152) {
        document.getElementsByTagName("body").style.width="1075px";
    }
}
window.onresize = function() {
    adjustWidth();
};
window.onload = function() {
    adjustWidth();
};
Run Code Online (Sandbox Code Playgroud)

使用此脚本,我从Firebug收到错误:

document.getElementsByTagName("body").style is undefined
Run Code Online (Sandbox Code Playgroud)

现在我的问题是,我怎样才能获得身体的风格?因为在css表中定义了它的selector和width属性.

html javascript dom

8
推荐指数
3
解决办法
3万
查看次数

php中的静态变量和全局变量有什么区别?

可能重复:
php中"GLOBAL"和"STATIC"变量之间的区别是什么

如果我们在函数内部创建一个静态变量,这个变量存在于函数的进一步使用中......据我所知,全局变量也是如此.现在使用静态变量有什么好处?

php variables static global

4
推荐指数
1
解决办法
2062
查看次数

无法在Mac OS X上运行mongod

我已经安装mongodb使用homebrew.该mongo命令在终端中按预期运行,但是当我mongod在终端中运行时它返回:

mongod --help for help and startup options
2014-09-27T12:55:42.705+0330 [initandlisten] MongoDB starting : pid=3704 port=27017 dbpath=/data/db 64-bit host=Your-MacBook-Pro.local
2014-09-27T12:55:42.705+0330 [initandlisten] 
2014-09-27T12:55:42.705+0330 [initandlisten] ** WARNING: soft rlimits too low. Number of files is 256, should be at least 1000
2014-09-27T12:55:42.705+0330 [initandlisten] db version v2.6.4
2014-09-27T12:55:42.705+0330 [initandlisten] git version: nogitversion
2014-09-27T12:55:42.705+0330 [initandlisten] build info: Darwin Your-MacBook-Pro.local 13.4.0 Darwin Kernel Version 13.4.0: Sun Aug 17 19:50:11 PDT 2014; root:xnu-2422.115.4~1/RELEASE_X86_64 x86_64 BOOST_LIB_VERSION=1_49
2014-09-27T12:55:42.705+0330 [initandlisten] allocator: tcmalloc …
Run Code Online (Sandbox Code Playgroud)

macos homebrew mongodb

2
推荐指数
1
解决办法
3738
查看次数

标签 统计

anchor ×1

border ×1

css ×1

dom ×1

global ×1

homebrew ×1

html ×1

image ×1

javascript ×1

macos ×1

mongodb ×1

php ×1

static ×1

variables ×1