在滚动条后面扩展元素(Extend an element behind a scrollbar)
如何在容器内部制作彩色横幅延伸到透明滚动条下方?
我想使用一个部分透明的自定义滚动条,让你看到背后的背景。 在可滚动内容中,存在不同颜色的横幅。 下面的示例代码显示了这些横幅延伸到滚动条,然后停止,留下透明滚动条来显示容器的背景颜色,这使滚动条的整个透明效果变得难看。 如何在滚动条下方展开这些横幅?
#container { width: 300px; height: 200px; overflow-y: auto; background: black; } #banner1, #banner2 { width: 100%; height: 150px; } #banner1 {background: red} #banner2 {background: yellow} /* Creates a transparent scrollbar */ ::-webkit-scrollbar { width: 16px; } ::-webkit-scrollbar-thumb { border: 4px solid rgba(0,0,0,0); background-clip: padding-box; background-color: rgba(255,255,255,0.3); }
<div id='container'> <div id='banner1'></div> <div id='banner2'></div> </div>
How can I make colored banners inside a container extend underneath a transparent scrollbar?
I want to use a custom scrollbar that's partially transparent which let's you see whatever background is behind it. Within the scrollable content there are banners which are differing colors. The example code below shows these banners extending as far as the scrollbar, then stopping, leaving the transparent scrollbar to show the background color of the container, which makes the whole transparent effect of the scrollbar kind of ugly. How can I extend these banners underneath the scrollbar?
#container { width: 300px; height: 200px; overflow-y: auto; background: black; } #banner1, #banner2 { width: 100%; height: 150px; } #banner1 {background: red} #banner2 {background: yellow} /* Creates a transparent scrollbar */ ::-webkit-scrollbar { width: 16px; } ::-webkit-scrollbar-thumb { border: 4px solid rgba(0,0,0,0); background-clip: padding-box; background-color: rgba(255,255,255,0.3); }
<div id='container'> <div id='banner1'></div> <div id='banner2'></div> </div>
原文:https://stackoverflow.com/questions/44317878
最满意答案
$@
是一个字符串数组。 您可能希望一次处理一个字符串,而不是一起处理。for i; do if [[ $i =~ ^-?[[:digit:]]+\.?[[:digit:]]*$ ]] || [[ $i =~ ^-?\.?[[:digit:]]+$ ]]; then echo yes - $i else echo no - $i fi done
$@
is an array of strings. You probably want to process the strings one at a time, not all together.for i; do if [[ $i =~ ^-?[[:digit:]]+\.?[[:digit:]]*$ ]] || [[ $i =~ ^-?\.?[[:digit:]]+$ ]]; then echo yes - $i else echo no - $i fi done
相关问答
更多-
TCP/IP模型是一个________。[2023-10-02]
a -
下列中不属于面向对象的编程语言的是?[2022-05-30]
a -
首先:在shell中,你应该把引用看作是围绕数据的东西,而不是数据中的东西。 你在数据中嵌入了引号,期待它们像数据一样工作,而且它不会那样工作。 更具体地说,shell在替换变量值之前会解析引号(以及转义和其他一些事物),因此如果您在变量的值中有引号,则在引用到命令行中时,它太迟了具有预期的效果。 那么当你的每个端口名可能包含空格时,你怎样将每个端口名保持为一个单独的项? 在bash中,可以将它们存储在一个数组中,并使用"${arrayname[@]}"展开数组 - 双引号和[@]的组合使bash将每个数组 ...
-
通过vim普通模式从键盘传递多个数字作为函数的参数(Pass multiple numbers from keyboard via vim normal mode as arguments of function)[2019-07-19]
直接回答 这是你要求的,但需要注意的是,这是非常常见的: function! PrintNum(b) echo g:a a:b endfunction nnoremap: let g:a = v:count nnoremap : call PrintNum(v:count) 规范的Vim风格 映射通常只需要计数和/或寄存器 。 如果需要更多,通常使用自定义命令 : command! -nargs ... -
使用cat , join和cut : 文件infile和ids : a1,b1,c1,d1 1 a2,b2,c2,d2 3 a3,b3,c3,d3 4 a4,b4,c4,d4 5 a5,b5,c5,d5 6 a6,b6,c6,d6 a7,b7,c7,d7 删除选定的行: $ join -v 2 ids <(cat -n infile) | cut -f 2 -d ' ' a2,b2,c2,d2 a7,b7,c7,d7 这是怎 ...
-
用于测试程序的Bash脚本(Bash script for testing a program)[2022-06-24]
我会改变程序接受字符串作为命令行参数反转,然后打印反转的字符串作为输出。 然后,使用bash脚本将程序的输出与预期输出进行比较。 int main(int argc, char* argv[]){ if ( argc != 2 ) { fprintf(stderr, "Expect to see one argument.\n"); return EXIT_FAILURE; } char* str = argv[1]; size_t size_re ... -
$@是一个字符串数组。 您可能希望一次处理一个字符串,而不是一起处理。 for i; do if [[ $i =~ ^-?[[:digit:]]+\.?[[:digit:]]*$ ]] || [[ $i =~ ^-?\.?[[:digit:]]+$ ]]; then echo yes - $i else echo no - $i fi done $@ is an array of strings. You probably want to proce ...
-
dorun + map => doseq (doseq [x (big-test-numbers)] (is (= x (-> x int-to-bytes bytes-to-int)))) dorun + map => doseq (doseq [x (big-test-numbers)] (is (= x (-> x int-to-bytes bytes-to-int))))
-
它失败了,因为你不能在shell中使用范围指令中的变量,即{1..10}很好,但{1..$n}不是。 使用BASH时,您可以使用((...))运算符: for ((i=1; i<=count; i++)); do array[$i]=$(cut -d',' -f3 file.txt | sort -r | uniq | tail -n $i) done 还要注意从命令中删除无用的cat 。 It fails because you cannot use a variable in range dir ...
-
你的问题会留下一些关于你想要做什么的猜测工作。 你没有在任何地方使用$2 ,所以你只想用它作为标志来决定以不同的方式运行grep? 如果是这样,使用$#将告诉你传递了多少个参数。 要测试是否有两个,你可以使用(( $# = 2 )) 。 正如Tom Fenech所说,您的代码中存在语法错误。 在] then应该有分号,或者then应该换上新的分号。 此外,我相信你之后[和之前]需要空格。 所以这里猜测你可能会尝试做什么: if (( $# == 2 )); then grep -i a -1 --co ...