justify-items在CSS Grid中不起作用(justify-items not working in CSS Grid)
我有一个CSS Grid,我正在尝试设置
justify-items
属性。这个(或与之相关的任何其他属性)都不起作用,在我的文本编辑器(atom)中,它显示为灰色,通常表示错误。
我看过规范,这个属性肯定是规范的一部分,甚至找到了它的视频教程。
当我使用它虽然它不起作用,我无法理解为什么。
当我将代码复制到codepen时,它仍然无法正常工作。
这里的代码: https ://codepen.io/emilychews/pen/EvLPgJ
.gridwrapper { background: #e6e6e6; display: grid; grid-template-columns: repeat(8, 1fr); grid-auto-rows: 100px; grid-row-gap: 10px; grid-column-gap: 10px; justify-items: start; /* THIS LINE ISN'T WORKING */ align-items: stretch; } .gridwrapper div:nth-child(1) { grid-column: 1 / 4; } .gridwrapper div:nth-child(6) { grid-column: 1 / 3; } .gridwrapper div { padding: 1em; background: red; border: white; width: 100%; color: white; box-sizing: border-box; } .gridwrapper div:nth-child(odd) { background: blue; }
<div class="gridwrapper"> <div class="grid double-col double-row">1</div> <div class="grid">2</div> <div class="grid">3</div> <div class="grid">4</div> <div class="grid">5</div> <div class="grid">6</div> <div class="grid">7</div> <div class="grid">8</div> </div>
I've a CSS Grid, and I'm trying to set the
justify-items
property tostart
.This (or any of the other properties relating to it) aren't working and in my text editor (atom) it is showing as grayed out which usually means an error.
I've looked at the specification and this property is definitely part of the spec and have even found a video tutorial of it working.
When I use it though it doesn't work and I can't get my head around why.
When I have copied the code to codepen it still does not work.
The codepen here: https://codepen.io/emilychews/pen/EvLPgJ
.gridwrapper { background: #e6e6e6; display: grid; grid-template-columns: repeat(8, 1fr); grid-auto-rows: 100px; grid-row-gap: 10px; grid-column-gap: 10px; justify-items: start; /* THIS LINE ISN'T WORKING */ align-items: stretch; } .gridwrapper div:nth-child(1) { grid-column: 1 / 4; } .gridwrapper div:nth-child(6) { grid-column: 1 / 3; } .gridwrapper div { padding: 1em; background: red; border: white; width: 100%; color: white; box-sizing: border-box; } .gridwrapper div:nth-child(odd) { background: blue; }
<div class="gridwrapper"> <div class="grid double-col double-row">1</div> <div class="grid">2</div> <div class="grid">3</div> <div class="grid">4</div> <div class="grid">5</div> <div class="grid">6</div> <div class="grid">7</div> <div class="grid">8</div> </div>
原文:https://stackoverflow.com/questions/45805962
最满意答案
@echo off setlocal EnableDelayedExpansion rem The list of filenames will be read from redirected Stdin < filenames.txt ( rem Process the files via FOR command for %%a in (*.*) do ( rem Read the next name from the list set /P name= rem Rename the file ren "%%a" "!name!" ) )
@echo off setlocal EnableDelayedExpansion rem The list of filenames will be read from redirected Stdin < filenames.txt ( rem Process the files via FOR command for %%a in (*.*) do ( rem Read the next name from the list set /P name= rem Rename the file ren "%%a" "!name!" ) )
相关问答
更多-
使用命令提示符意外删除具有长扩展名的文件(Files with long extensions unexpectedly deleted using command prompt)[2021-09-26]
从命令提示符使用通配符执行文件管理时,具有长扩展名的文件可能会意外显示,复制或删除。 你是对的,它也发生在我的电脑上,运行完整补丁的Windows XP SP3。 请参阅下面的Microsoft知识库文章以获取更多信息以及解决该问题的注册表更改。 这个一直回到Windows NT 4.0: 文章编号:164351 - 最后修改:2006年11月1日 - 修订:1.1 命令提示符处理长文件扩展名 http://support.microsoft.com/kb/164351 更新:此行为也发生在我编写的测试C# ... -
未经测试: @echo off setlocal enableDelayedExpansion for %%a in ("C:\Test\ABC*.doc") do ( set docname=%%~nxa echo !docname:~3! ) 在命令提示符下: cmd /v:on /c "for %a in ("C:\Test\ABC*.doc") do set docname=%~nxa & echo !docname:~3!" Not tested: @echo off s ...
-
Windows脚本FOR命令重命名目录中的所有文件(Windows scripting FOR command to rename all files in a directory)[2024-04-26]
如果您知道文件数量(例如10),则可以使用 for /L %1 in (1,1,10) do ren enc%1.ctl test%1.ctl If you know the number of files, (say 10), you can use for /L %1 in (1,1,10) do ren enc%1.ctl test%1.ctl -
要从FileMaker运行cmd,请在FileMaker脚本中使用“发送事件”脚本步骤,将“发送”下拉列表设置为“打开文档/应用程序”并选择“文本”选项。 在文本框中输入 cmd.exe /c "your cmd command" 例如 cmd.exe /c MKDIR "C:\Users\Nicolai\Desktop\ImportantStuff" 你有几个选项来恢复输出。 将CMD的输出保存为文本文件并将其作为文本文件导入到FileMaker中 将输出保存为XML并将其作为XML导入 将输出保存为 ...
-
使用命令提示符重命名文件名以包含昨天的日期(Re-naming a file name to include yesterday's date using command prompt)[2022-04-04]
简单的方法 - 假设您每天定期运行一次 FOR /f %%a IN (sampledteyesterday.txt) DO ECHO ren SampleDTE.TXT SampleDTE-%%a_%time:~0,2%%time:~3,2%.txt > sampledteyesterday.txt ECHO %date:~10,4%%day%%date:~4,2% 注意 - ren命令只是ECHO ed。 验证后,在REN激活之前删除ECHO关键字。 您需要设置sampledteyesterday.tx ... -
如果正确设置%PATH%以查看C:\Program Files\Sublime Text 2 ,则可以使用sublime_text从命令行运行Sublime, sublime_text是可执行文件的名称,而不是sublime 。 例如,要打开当前目录,只需运行即可 sublime_text . If your %PATH% is properly set up to look in C:\Program Files\Sublime Text 2, you can run Sublime from the ...
-
你几乎得到它了: For %A In (*.outable) Do Ren "%A" "%~nA_Hole_1.txt" 请注意,上面的代码适用于命令提示符条目,如果您在批处理文件中使用它,请将每个百分比字符加倍。 You've nearly got it: For %A In (*.outable) Do Ren "%A" "%~nA_Hole_1.txt" Note the above code is for Command prompt entry, if you use it in a batc ...
-
for /R /D %i in (*.*) do ren %i\*.old *.new /D将仅选择目录, /R将递归子目录。 for /R /D %i in (*.*) do ren %i\*.old *.new The /D will select directories only, and the /R will recurse subdirectories.
-
命令提示符搜索目录中的文件时,请使用一个随机名称(Command Prompt Search for files in a directory take the name of one random)[2022-03-19]
为此,您可以使用以下内容...... 首先,要获取所有.rac文件,请使用dir命令。 /B开关指定仅输出没有任何页眉或页脚的裸文件列表。 如果要以递归方式搜索给定目录,请添加/S开关: dir /B "C:\configs\*.rac" 其次,您需要计算返回的.rac文件的数量。 你可以使用for /F循环(解析dir / B的输出)和set /A : set /A COUNT=0 for /F "delims=| eol=|" %%L in ( 'dir /B "C:\configs\*.rac" ... -
@echo off setlocal EnableDelayedExpansion rem The list of filenames will be read from redirected Stdin < filenames.txt ( rem Process the files via FOR command for %%a in (*.*) do ( rem Read the next name from the list set /P name= ...