我的代码是这样的.
<div class="outer">
<div class="inner">some text here
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
CSS:
.outer {
max-width:1024px;
background-color:red;
margin:0 auto;
}
.inner {
width:50px;
border:1px solid white;
position:fixed;
}
Run Code Online (Sandbox Code Playgroud)
默认情况下左侧定位的内部div需要位于外部div的右侧而不是页面.
如果我提到它是正确的:0px; 它使得从浏览器执行0px而不是外部div的权利.
注意:我的外部div不是固定宽度.它根据屏幕分辨率进行调整.它是响应式网站设计.
我有这样的DIV设置.
<div id="parent" class="parent">
<div id="child" class="child">
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
样式
<style>
.parent{
float:left; height:300; width:300px; background-color:#00ff00;
}
.child{
float:left; height:60; width:60px; background-color:#00ff00;
}
</style>
<script>
function move(){
while(m < 100){
document.getElementByid('child').style.marginTop = m;
m = m+1;
}
}
move();
</script>
Run Code Online (Sandbox Code Playgroud)
我想从上到下逐像素地移动内部DIV(命名子)100像素.我认为可以使用style.marginTop =''和settimeout()函数来完成
但仍然无法使这项工作.
我从USPS收到此错误我正在http://production.shippingapis.com/ShippingAPI.dll?API=RateV4&XML=进行查询
<Error>
<Number>80040b1a</Number>
<Description>Authorization failure. You are not authorized to connect to this server.</Description>
<Source>UspsCom::DoAuth</Source>
</Error>
Run Code Online (Sandbox Code Playgroud)
如果我在测试服务器http://production.shippingapis.com/ShippingAPItest.dll?API=RateV4&XML=进行相同的查询,它会让我得到以下错误
<Error>
<Number>80040b1a</Number>
<Description>API Authorization failure. RateV4 is not a valid API name for this protocol.</Description>
<Source>UspsCom::DoAuth</Source>
</Error>
Run Code Online (Sandbox Code Playgroud) 我有一个名为categories
字段的mysql表
Category_id, Category_name, Category_sorted
1 food 0
2 drinks 0
3 milk 0
4 snacks 0
....
2421 other 0
Run Code Online (Sandbox Code Playgroud)
在这里,我想更新所有category_id值,category_sorted以便它应该是这样
Category_id, Category_name, Category_sorted
1 food 1
2 drinks 2
3 milk 3
4 snacks 4
....
2421 other 2421
Run Code Online (Sandbox Code Playgroud)
我可以用PHP做到这一点,但我想知道是否可以用单个mysql查询更新相同的内容.
这是我的代码
<script>
function showin(box) {
cur = parseInt(document.getElementById(box).style.marginTop);
alert(cur);
}
showin('child');
</script>
<div id="parent" class="parent">
<div id="child" class="child" style="margin-top:-10px;">
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
为什么它没有给我任何警告信息?