我正在尝试将https://www.example.com重定向到http://www.example.com.我在.htaccess文件中尝试了以下代码
RewriteEngine On
RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
Run Code Online (Sandbox Code Playgroud)
此代码成功将https://example.com重定向到http://www.example.com.但是,当我输入https://www.example.com时,它会在浏览器中显示"网页不可用"错误.
我也尝试了以下2个代码但没有成功
尝试1
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^/(.*):NOSSL$ http://www.example.com/$1 [R=301,L]
Run Code Online (Sandbox Code Playgroud)
尝试2
RewriteEngine On
RewriteCond %{HTTPS} on
RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI}
Run Code Online (Sandbox Code Playgroud)
以上两种尝试均失败.有什么建议?
当我选中或取消选中时,我正在尝试更改复选框标签的字体颜色和背景颜色.我在这个网站上找到了一个javascript解决方案但是无法让代码工作.这是我到目前为止所尝试的内容.现在它将"突出显示"类附加到父div,我只希望标签更改.谢谢你的时间.
HTML:
<div class="checkboxes">
<input type="checkbox" name="1" id="option one" value="orange"><label for="1" class="highlight">Orange</label>
<input type="checkbox" name="2" id="option two" value="apple"><label for="1" class="highlight">Apple</label>
</div>
Run Code Online (Sandbox Code Playgroud)
JavaScript:
$( '.checkboxes' ).on( 'click', 'input:checkbox', function () {
$( this ).parent().toggleClass( 'highlight', this.checked );
}); // end checkbox style?
Run Code Online (Sandbox Code Playgroud)
CSS:
.checkboxes label {
font-family:Open Sans Italic;
font-size: 12px;
color: #666;
border-radius: 20px 20px 20px 20px;
background: #f0f0f0;
padding: 3px 10px;
text-align: left;
}
.highlight {
font-family:Open Sans Italic;
font-size: 12px;
color: white;
border-radius: 20px 20px …Run Code Online (Sandbox Code Playgroud) 我想在 D3.js 图表顶部的两行中显示 10 个图例元素。我尝试过以下方法
legend.append("rect").attr("width", 20).attr("height", 15).style("fill", function(d) {
return color(d.packageName);
});
legend.append("text").attr("dx", +25).attr("dy", "0.8em").style("text-anchor","front").style("fill", "#666").text(function(d) {
return d.packageName;
});
var margin = {
top: 30,
right: 20,
bottom: 30,
left: 40
};
d3.selectAll(".legend").each(function(d, i) {
return d3.selectAll(".legend").attr("transform", i < 6 ? function(d, i) {
return "translate(" + ((i * 100) + (diameter / 10) - 25) + "," + (+margin.top * 2) +")";
} : function(d, i) {
return "translate(" + ((i * 100) + (diameter / 10) …Run Code Online (Sandbox Code Playgroud)