我很困惑,仍然不确定如何用恰当的话来解释这一点.到目前为止,我已经使用Breakpoint设置了我的媒体查询.使用的断点变量看起来像例如:
$menustatictofixed: min-width 900px;
Run Code Online (Sandbox Code Playgroud)
$ breakpoint-to-ems设置为true.我根据以下jQuery代码段的像素值布置了包含所有Breakpoint变量的页面:
$('body').append('<div style="position: fixed; bottom: 0; right: 0; display: inline-block; font-weight: bold; padding: 5px 7px; border-radius: 5px 0 0 0; background: green; color: white; z-index: 9999;">Viewport width <span id="width"></span> px</div>');
var viewportWidth = $(window).width()
$('#width').text(viewportWidth);
$(window).resize(function() {
var viewportWidth = $(window).width();
$('#width').text(viewportWidth);
});
Run Code Online (Sandbox Code Playgroud)
一切看起来都很干净.但是在过去的一两天里,我遇到了为模式设置最后断点并让事情表现出可预测性的问题.在某种程度上,首先看起来干净整洁的东西,我现在在逻辑上非常怀疑,实际上是不合适的,不知何故是一团糟.Cuz,如果你看一下下面的截图,窗口的宽度(在Chrome中)与使用window.width的jQuery代码段的宽度不同.如果我用window.innerWidth替换window.width来最终排除滚动条也没有区别.获得正确结果的唯一方法是在等式中添加15个像素:
var viewportWidth = $(window).width() + 15;
Run Code Online (Sandbox Code Playgroud)
整个方程中唯一的问题是window.width是错误的函数选择,最好是使用例如document.documentElement.clientWidth或其他东西或......?对于15个像素代表什么,以一点点hacky方式修复了上面的问题?最好的问候拉尔夫
Apple 仅支持最后两个主要操作系统版本。这导致 Docker 和 Homebrew 放弃了对这些的支持。在撰写本文时,macOS Monterey 是当前版本,而最后支持的版本是 macOS Catalina。对于 macOS Catalina,最低硬件要求是 MacBook Pro/Air Mid 2012。许多仍然不错的计算机未能满足要求。但是如何在只能运行 macOS High Sierra 等旧版 Mac 上设置 Docker 和 DDEV。
在我最大的桌面视图/断点中,我尝试在Susy演示页面(http://susy.oddbird.net/demos/magic/)上完成相同的行为- 当达到容器最大宽度时,只有填充或边距当容器本身保持最大宽度时,每侧都在增长.
但是我仍然对像优选单元这样的几个点有点困惑,以及实现所描述的填充/边距行为的最佳功能是什么.
我目前的一般Susy设置如下:
$total-columns: 24;
$column-width: 3%;
$gutter-width: 1%;
$grid-padding: 0;
Run Code Online (Sandbox Code Playgroud)
特定的Scss部分看起来像那样.我已经包括一个容器,并通过压扁边缘与它边缘:
.sectionwrap{
@include container;
@include squish(3,3);
@include breakpoint($medium) {
@include squish(2,2);
}
@include breakpoint($small) {
@include squish(1,1);
}
}
Run Code Online (Sandbox Code Playgroud)
但问题是容器和压扁区域都会成长,成长并按比例增长.可能有一个缺点是使用的单位是百分比?使用em或rem会更合理吗?
总结并达到最大宽度的手段(列数*(柱宽+沟宽))自动只有压扁区域在理论上继续增长?但我尝试了它失败了.
我也尝试过:
$container-width: 1000px;
Run Code Online (Sandbox Code Playgroud)
但也没有运气.任何提示都表示赞赏.最好的问候拉尔夫
更新: 我首先将我的网站重新安排到移动设备,并认为我得到了整个Susy网格概念,这个概念在最初的squish()事件中有点误导.:s但不知怎的,我猜我又做错了什么.
// breakpoint variable set for Breakpoint - value is converted to em by Breakpoint
$fivehundred: min-width 500px;
//basic Susy settings for the initial mobile viewport
$total-columns: 8;
$column-width: 3em;
$gutter-width: 1em;
$grid-padding: 1em;
//modified Susy setting for a larger …Run Code Online (Sandbox Code Playgroud) 我有一个带有高级自定义字段插件的 WYSIWG 字段。当我查询它时:
<p class="bran-hn news-excerpt"><?php echo custom_field_excerpt('news_post'); ?></p>
Run Code Online (Sandbox Code Playgroud)
输出看起来像这样:
<p class="bran-hn news-excerpt"></p>
<p>Worf, It's better than music. It's jazz. Mr. Crusher, ready a collision course with the Borg ship. This is not about revenge. This is about justice. The Federation's gone; the Borg is everywhere! In all trust, [...]</p>
<p></p>
Run Code Online (Sandbox Code Playgroud)
但我会期望并想要类似的东西:
<p class="bran-hn news-excerpt">Worf, It's better than music. It's jazz. Mr. Crusher, ready a collision course with the Borg ship. This is not about revenge. This is about justice. …Run Code Online (Sandbox Code Playgroud) 我或多或少是一个正则表达式的新手.我试图将以下条件变为正则表达式:
导致以下正则表达式:
^\S[\d\/. ()\-+]*\S$
Run Code Online (Sandbox Code Playgroud)
但现在我尝试应用另外两个条件:
我的问题是如何将这两个条件合并到现有的正则表达字符串上面cuz排除+ [+]{1,2}和()[(]{1} [)]{1}没有多大意义因为我尝试以无特定顺序制作一般语句,以便我能够链接它.谢谢拉尔夫
我试图解决亚像素舍入误差已经有一段时间了,但到目前为止,我一次又一次地失败了.我试图在Sass和Susy的帮助下完成这项努力.我在上次尝试中使用的mixin来自Github上的Susy问题跟踪器(我已经使用了空格,列以及按下左边/右边边缘的属性,就像那里建议的那样):
@mixin isolate($location, $context: $columns, $dir: 'ltr') {
@if $dir == 'ltr' {
margin-right: -100%;
margin-left: space($location, $context);
}
@else if $dir == 'rtl' {
margin-left: -100%;
margin-right: space($location, $context);
}
}
Run Code Online (Sandbox Code Playgroud)
我的Scss如下所示:
.imggrid{
@include with-grid-settings($gutter: 0.1%){
$y:2;
li{
@include span-columns(2,12);
@for $x from 1 through 30
{
&:nth-child(#{$x}){
@include isolate($y,12);
$y: $y + 2;
@if $y > 12{
$y: 2;
}
}
}
@include nth-omega(6n);
}
}
}
Run Code Online (Sandbox Code Playgroud)
首先,我为图像网格创建了一个自定义装订线.然后我定义了一个变量y,以两个步骤迭代,以便能够调用isolate mixin(isolate(2,12)isolate(4,12)etc).对于大于12的值,该值在最后的for循环中重置为2.然后我跨越一列,每个李走过30张图像.每次调用迭代隔离mixin.在for循环后,我添加了@include nth-omega(6n); 在每个第六个元素之后获得一个新行.
但不知怎的,它根本不起作用.前四行缺少第一个图像,而最后一行缺少前五个元素.任何想法和建议表示赞赏.谢谢拉尔夫
我试图在osx 10.8.5上的bash脚本中构建一个随机字符生成器.目标是为生成wordpress wp-config.php文件的盐的脚本生成随机字符串.该代码段如下所示:
#!/bin/bash -e
read -p "Number of digits: " digits
function rand_char {
take=$(($RANDOM % 88)); i=0; echo {a..z} {A..Z} {0..9} \, \; \. \: \- \_ \# \* \+ \~ \! \§ \$ \% \& \( \) \= \? \{ \[ \] \} \| \> \< | while read -d\ char;
do
[ "$i" = "$take" ] && echo "$char\c";
((i++));
done
}
function rand_string {
c=$1;
while [ $c -gt 0 ];
do char="${char}"$(rand_char);
let …Run Code Online (Sandbox Code Playgroud)