我试图使黑色div(相对)高于第二个黄色(绝对).黑人div的父母也有绝对的位置.
码:
#relative {
position: relative;
width: 40px;
height: 100px;
background: #000;
z-index: 1;
margin-top: 30px;
}
.absolute {
position: absolute;
top: 0; left: 0;
width: 200px;
height: 50px;
background: yellow;
z-index: 0;
}
Run Code Online (Sandbox Code Playgroud)
<div class="absolute">
<div id="relative"></div>
</div>
<div class="absolute" style="top: 54px"></div>
Run Code Online (Sandbox Code Playgroud)
预期结果:
我想在 aDropdownButton
旁边垂直对齐a TextField
。
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
DropdownButton<String>(
...
),
Flexible(
child: TextField(
...
),
),
],
)
Run Code Online (Sandbox Code Playgroud)
目前的行为是:
如您所见,底线未对齐。我想这是由于身高差异而发生的。什么是解决这个问题的好习惯?(我猜没有使用固定高度)
我的最终目标是这样的:
在两条线和文字DropdownButton
和TextField
垂直对齐。
我知道如何在css中做一个掩码,但只有chrome和safari支持这个.这有什么替代品吗?
这是我的代码:
<div class="character">
<img src="http://img194.imageshack.us/img194/3854/goldgladiator.png">
<div class="green-mask"></div>
</div>
<style>
.green-mask {
display: block;
height: 200px;
width: 508px;
background: rgb(160, 255, 97);
opacity: .3;
position: absolute;
top: 0;
-webkit-mask-image: url(http://img194.imageshack.us/img194/3854/goldgladiator.png);
}
</style>
Run Code Online (Sandbox Code Playgroud)
我想让它支持跨浏览器.
我正在 Flutter 中创建一个注册表单,我希望用户完成步骤。每一步都应该以滑动效果过渡到下一步。例如,如果我在第 1 步,移动到第 2 步应该将表单向左滑动,我应该得到表单 2。然后如果我回到表单 1,它应该向右滑动表单。
我试图用多条路线做到这一点:
routes: {
'/': (context) => HomePage(),
'/step1': (context) => FormStep1(),
'/step2': (context) => FormStep2(),
},
Run Code Online (Sandbox Code Playgroud)
然后提交:
Navigator.push(
context,
EnterExitRoute(exitPage: FormStep1(), enterPage: FormStep2())
);
Run Code Online (Sandbox Code Playgroud)
但这也会使 App Bar 滑动,我只希望表单滑动。
我买了一台服务器,我需要检查它的互联网连接(速度).
有一个简单的方法吗?
我用谷歌搜索但我找不到任何东西......
我这样做了:
<?php
$link = 'http://speed.bezeqint.net/big.zip';
$start = time();
$size = filesize($link);
$file = file_get_contents($link);
$end = time();
$time = $end - $start;
$speed = $size / $time;
echo "Server's speed is: $speed MB/s";
?>
Run Code Online (Sandbox Code Playgroud)
这是对的吗?
我正在使用以下命令从视频文件中提取字幕,并将其另存为vtt
.
ffmpeg -i video.mkv -map 0:s:0 subs.vtt 2>&1
Run Code Online (Sandbox Code Playgroud)
它正在工作并输出字幕文件。问题在于 RTL(从右到左)语言(希伯来语、阿拉伯语等)。标点符号放错了位置。
为了您的方便,我将向您展示正在发生的事情的英文示例:
输入文本:
Is he alive?
-I don't know.
Run Code Online (Sandbox Code Playgroud)
输出文本:
?Is he alive
.I don't know-
Run Code Online (Sandbox Code Playgroud)
如果你想要希伯来语原文,它是:
输入文本:
??? ???
-??? ?? ????.
Run Code Online (Sandbox Code Playgroud)
输出文本:
???? ??
.??? ?? ????-
Run Code Online (Sandbox Code Playgroud)
如您所见,末尾的标点符号指向开头,反之亦然。我怎样才能避免这种行为?
选择器类可以是:
c-1
c-2
c-3
(etc...)
Run Code Online (Sandbox Code Playgroud)
选择器也可以有其他类,所以这里是一个可能的HTML示例:
<div class="foo c-2 foofoo"></div>
Run Code Online (Sandbox Code Playgroud)
我希望得到之后的数字c
.在这种情况下 - 我会得到2
.
我怎样才能做到这一点?
我有一个使用tymon/jwt-auth软件包验证JWT用户的中间件:
public function handle($request, \Closure $next)
{
if (! $token = $this->auth->setRequest($request)->getToken()) {
return $this->respond('tymon.jwt.absent', 'token_not_provided', 400);
}
try {
$user = $this->auth->authenticate($token);
} catch (TokenExpiredException $e) {
return $this->respond('tymon.jwt.expired', 'token_expired', $e->getStatusCode(), [$e]);
} catch (JWTException $e) {
return $this->respond('tymon.jwt.invalid', 'token_invalid', $e->getStatusCode(), [$e]);
}
if (! $user) {
return $this->respond('tymon.jwt.user_not_found', 'user_not_found', 404);
}
$this->events->fire('tymon.jwt.valid', $user);
return $next($request);
}
Run Code Online (Sandbox Code Playgroud)
然后我有一个控制器,我想将用户从中间件传递给控制器.
所以我在控制器上做了:
public function __construct()
{
$this->user = \Auth::user();
}
Run Code Online (Sandbox Code Playgroud)
问题是,$this->user
是null
的,但我做这个控制器的方法时,它不是空.
所以:
public function __construct()
{ …
Run Code Online (Sandbox Code Playgroud) 我运行了一个 Laravel 应用程序,并将会话存储在 redis 上。每次刷新页面时都会生成一个新会话(我可以使用 看到它keys *
)并且会话的 cookie 也会相应地更改。
php -S
,也在 CentOS 服务器上运行,两者都存在问题。我的 session.php 文件:
return [
/*
|--------------------------------------------------------------------------
| Default Session Driver
|--------------------------------------------------------------------------
|
| This option controls the default session "driver" that will be used on
| requests. By default, we will use the lightweight native driver but
| you may specify any of the other wonderful drivers provided here.
|
| Supported: "file", "cookie", "database", "apc",
| "memcached", "redis", …
Run Code Online (Sandbox Code Playgroud) 我Radio
在一个ListTile
. 当ListTile
被点击时,我改变Radio
的价值。我不希望收音机可点击,所以我不提供onChanged
回调:
ListTile(
onTap: () => onChanged(template.id),
leading: Radio(
value: template.id,
groupValue: checkedId,
)
...
)
Run Code Online (Sandbox Code Playgroud)
这样做后,它Radio
会变得“不活动”并将其颜色更改为灰色。该Radio
有一个activeColor
财产,但不为无效。
如果我为Radio
的onChanged
属性提供了一个虚拟函数- 它会变为活动状态,但问题是我不希望它可点击,我只希望ListTile
可点击(原因是 - 我希望能够取消选中Radio
)
此外,我只想更改那些特定Radio
按钮的非活动颜色,而不是整个应用程序。
当前结果:
结果onChange
(单击时无法取消选中收音机):
flutter ×3
php ×3
css ×2
dart ×2
laravel ×2
laravel-5.1 ×2
absolute ×1
class ×1
css-position ×1
dingo-api ×1
download ×1
ffmpeg ×1
html ×1
jquery ×1
mask ×1
monitor ×1
performance ×1
radio-button ×1
session ×1
startswith ×1
webvtt ×1