我有以下代码
div {
width:200px;
border-bottom:1px solid magenta;
height:50px;
}
Run Code Online (Sandbox Code Playgroud)
div宽度为200px,因此border-bottom也是200px但是如果我想边框底部只有100px而不改变div宽度该怎么办?
这是我必须为我的作业重构的代码:
if (state == TEXAS) {
rate = TX_RATE;
amt = base * TX_RATE;
calc = 2 * basis(amt) + extra(amt) * 1.05;
} else if ((state == OHIO) || (state == MAINE)) {
rate = (state == OHIO) ? OH_RATE : MN_RATE;
amt = base * rate;
calc = 2 * basis(amt) + extra(amt) * 1.05;
if (state == OHIO)
points = 2;
} else {
rate = 1;
amt = base;
calc = 2 * basis(amt) + extra(amt) …Run Code Online (Sandbox Code Playgroud) 这是我从http://jqueryui.com/demos/draggable/获取的代码
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery UI Draggable - Default functionality</title>
<link rel="stylesheet" href="../../themes/base/jquery.ui.all.css">
<script src="../../jquery-1.6.2.js"></script>
<script src="../../ui/jquery.ui.core.js"></script>
<script src="../../ui/jquery.ui.widget.js"></script>
<script src="../../ui/jquery.ui.mouse.js"></script>
<script src="../../ui/jquery.ui.draggable.js"></script>
<link rel="stylesheet" href="../demos.css">
<style>
.draggable { width: 150px; height: 150px; padding: 0.5em; }
</style>
<script>
$(function() {
$( ".draggable" ).draggable();
$('.content').click(function(){
var htmlData='<div class="draggable ui-widget-content ui-draggable"><p>Drag me around</p></div>';
$('.demo').append(htmlData);
});
});
</script>
</head>
<body>
<div class="demo">
<div class="draggable ui-widget-content">
<p>Drag me around</p>
</div>
<div class="content">Test </div>
</div><!-- End demo -->
</body> …Run Code Online (Sandbox Code Playgroud) 我刚刚在答案中看到了这段代码:
HTML
<div class="thumbnail">
<img src="http://placehold.it/50x50">
<img class="overthumb" src="http://placehold.it/200x200">
</div>
Run Code Online (Sandbox Code Playgroud)
CSS
.overthumb { display: none; }
.thumbnail:hover .overthumb {
position: absolute;
top: 15px; left: 15px;
display: inline;
}
Run Code Online (Sandbox Code Playgroud)
现场演示:http://jsfiddle.net/6wQp3/
为此代码工作.overthumb必须是孩子的.thumbnail.
但如果有人有这个代码:
<div class="thumbnail">
<img src="http://placehold.it/50x50">
</div>
<p>tttttttttt</p>
Run Code Online (Sandbox Code Playgroud)
p如果.thumbnail悬停,你会如何选择标签?
我的查询中出现以下错误System.Data.SqlClient.SqlException: Incorrect syntax near the keyword 'Distinct'.我搜索了谷歌,但根据我的查询找不到任何有用的解决方案.我的查询就是这个
SqlCommand myCommand = new SqlCommand("select ItemId,Distinct Size from ItemTilesSizes ",
myConnection);
Run Code Online (Sandbox Code Playgroud)
我的表名是ItemTilesSizes,它有两列
ItemId Size
1 8x13
1 8x12
5 8x10
5 8x12
5 8x13
8 10x10
8 4x4
9 8x12
14 8x13
15 8x10
15 24x24`
Run Code Online (Sandbox Code Playgroud) 我尝试使用代码来获取div上的动画边框,但我无法在左侧和右侧获取它.这是我的代码
<div id="test">test</div>
#test
{
position:absolute;
width:200px;
top:100px;
left:50px;
-moz-border-image:url(http://i.imgur.com/GziKo.gif) 8 0 stretch;
}
Run Code Online (Sandbox Code Playgroud)
这里是小提琴http://jsfiddle.net/ahvSR/30/
谢谢
编辑
虽然@Mihalis Bagos解决方案很好.但我对包装div不感兴趣我想在testdiv或者上做一些事情border-image
新编辑
我已经完成它使用border-image现在我的图像是4x4像素之前它是8x8像素.这里是http://jsfiddle.net/5rHCa/
但请任何人都可以彻底解释为什么它不适用于8x8像素.
最终编辑 它也可以通过8x8像素完成,但没有stackoverflow用户在我的小提琴中弄错了.看看我的答案.
另一个最终编辑
我用4x4和8x8 http://jsfiddle.net/5rHCa/和http://jsfiddle.net/LzS7b/发布的小提琴都没有在firefox 3.6上工作有没有人知道为什么这些不能在Firefox上工作它正在工作虽然在铬.
如何在绘制点时隐藏c3js中的点?例如在这个演示中
我有以下代码
<h1>Test</h1>
<p>Another test</p>
h1
{
border:2px solid red;
margin-bottom:30px;
}
p
{
border:2px solid red;
margin-top:20px;
}
Run Code Online (Sandbox Code Playgroud)
现场小提琴http://tinkerbin.com/dnhA713P
我希望在它之间有50px的空间h1,p但它没有得到50px的空间.
我刚写了下面的代码
<img src="http://www.lorempixel.com/100/100"><img src="http://www.lorempixel.com/100/150" id="test">
Run Code Online (Sandbox Code Playgroud)
#test {
text-align: center;
}
Run Code Online (Sandbox Code Playgroud)
但是图像不是居中的.我也用过text-align: right哪个也没用.我可以使用float和margin-left但我很好奇为什么它不使用text-align.
我有这样的字符串
$color="rgb(255, 255, 0)";
Run Code Online (Sandbox Code Playgroud)
我想在数组或三个不同的变量中获得值255,255,0.例如
$arr[0]=255;
$arr[1]=255;
$arr[2]=0;
Run Code Online (Sandbox Code Playgroud)
我认为可以在正则表达式中完成.但我很难受.谢谢