我正在设置单选按钮(隐藏它们并使用标签作为按钮),并尝试将边框半径放在first-child上,但它没有按预期响应,或者我做错了.
如何在第一个标签上实现左边界半径?
在这里看到它> http://jsfiddle.net/sthrc57f/
HTML:
<input type="radio" name="radios" id="radioone" value="one">
<label for="radioone">radio 1</label>
<input type="radio" name="radios" id="radiotwo" value="two" checked="checked">
<label for="radiotwo">radio 2</label>
Run Code Online (Sandbox Code Playgroud)
CSS:
input[type=radio] {
display:none;
}
input[type=radio] + label {
cursor: pointer;
display: inline-block;
margin: 0;
padding: 0.5em 2em 0.5em 2em;
background-color: #eeeeee;
color: #bbbbbb;
}
input[type=radio] + label:first-child {
border-top-left-radius: 7px;
border-bottom-left-radius: 7px;
-webkit-border-radius: 7px;
-webkit-border-bottom-left-radius: 7px;
-o-border-top-left-radius: 7px;
-o-border-bottom-left-radius: 7px;
-moz-border-top-left-radius: 7px;
-moz-border-bottom-left-radius: 7px;
}
input[type=radio]:checked + label {
background-color: green;
color: white;
}
input[type=radio]:checked + label:before …Run Code Online (Sandbox Code Playgroud) 在我的网站上,我都有一个登录表单和一个其他表单(这都是第二个表单)
它们可以同时出现在同一页面上
如何检查第二张表格是否已提交?
我了解到使用它是一个很好的做法:
if (strtoupper($_SERVER['REQUEST_METHOD']) === 'POST') { }
Run Code Online (Sandbox Code Playgroud)
但如果提交了登录表单,这也是如此
如何定位(检查是否已提交)第二个表单并忽略登录表单?我应该查一下它的名字吗?
我有一个点击功能,用于用户注销时
$('#logout').click(function(){
// update database and tell other users that this person has logged off
});
Run Code Online (Sandbox Code Playgroud)
#logout是链接的id(注销按钮)
该函数将处理一些ajax/php /数据库操作+发送socketmessage并且可能需要几个毫秒才能完成
我可以相信javascript/jquery在实际返回true之前完成该函数(打开单击的链接)吗?
或者是什么方法可以确保它完成它..以"return false"开头,然后只返回true,如果它从php收到OK例如?
我试图掌握UTF-8和charset编码,但这很棘手
这段代码:
<?php
header('Content-type: text/html; charset=utf-8');
?>
<!doctype html>
<html lang="da">
<head>
<title>UTF-8 test</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<div>
<p>UTF-8 æøå tést Señor!</p>
</div>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
输出:
UTF-8 ??? t?st Se?or!
Run Code Online (Sandbox Code Playgroud)
在本地服务器和多个公共站点上都有相同的结果(所有Apache)我是否需要在php中更改某些内容?还是Apache?还是我的文字编辑?(记事本++)
我用过
html, body {
background-image: something;
}
Run Code Online (Sandbox Code Playgroud)
在我的CSS多年.现在我不记得为什么真的......
这种方法是否必要/有益还是身体足够?
我只是无法获得点击链接来更改类并显示为活动链接
见小提琴:http://jsfiddle.net/kAW4g/
$(".navul a").on('click', function(e) {
$(this).addClass("navhover");
});
Run Code Online (Sandbox Code Playgroud)
我究竟做错了什么?
我正在尝试找到一种方法将对象移动到数组的末尾
我有这个对象数组:
[{"id":"4","name":"Boaz"},{"id":"2","name":"Shareen"},{"id":"3","name":"Simon"},{"id":"1","name":"Miriam"}]
Run Code Online (Sandbox Code Playgroud)
假设我有一个id:3,或者一个位置:2.
有了这个我想把整套{"id":"3","name":"Simon"}移到最后
我尝试了很多东西,搜索和搜索,但我无法使它工作
如何检查字符串是否包含任何位置/顺序中的至少2个字母?不区分大小写
这当然只适用于一个或多个字母
if (!preg_match('/[a-z]+/i', $pass)) {
}
Run Code Online (Sandbox Code Playgroud)
然后我尝试了类似的东西
if (!preg_match('/[a-z]{2,}/i', $pass)) {
}
Run Code Online (Sandbox Code Playgroud)
但这不起作用
谢谢
编辑:通过"任何位置/顺序"我的意思是12345ab/a12345b/12a345b6
替换某些元素上的所有背景图像的好方法是每个元素自己的id +".jpg"?使用jquery
我是否需要使用$ .each,或者我可以编辑它以某种方式工作:
$(".element").css("background-image", "url(img/" + $(this).data("id") + ".jpg)");
// it sets undefined.jpg, $(this) is not the way
Run Code Online (Sandbox Code Playgroud)
编辑PS:数据("id")不是拼写错误.我在元素上使用data.id