有没有办法创建一个无用的Html标签,该标签什么也不做(不会影响格式,内容,间距,更像一个空标签吗?它是span还是div?
我想在以下项目周围放置一个无用的标签。如果在前后添加span或div,它将在Codepen中向上移动项目。仅查找一个标签容器,而不是两个。
https://codepen.io/WebTesting41/pen/YoBmye
<i class="material-icons" style="font-size:48px;">notifications</i>
<i class="material-icons" style="font-size:48px;">delete</i>
代码:
.grid-container
{
display: grid;
grid-template-columns: repeat(1, 50px);
grid-template-rows: repeat(2, 50px);
grid-gap: 1px;
padding: 0px;
align-items: center;
}
.material-icons
{
text-align:center;
}
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<div class="grid-container" id="gridid1556351f5ece4ee3a7dce6962be48e39" >
<i class="material-icons" style="font-size:48px;">notifications</i>
<i class="material-icons" style="font-size:48px;">delete</i>
</div>
答案 0 :(得分:1)
分别用于两个元素。您在Codepen中为这两个元素使用了一个跨度。我已经编辑了html文件。核实。希望对您有帮助。
node-pre-gyp WARN Using request for node-pre-gyp https download
node-pre-gyp WARN Pre-built binaries not installable for fsevents@1.2.9 and node@12.2.0 (node-v72 ABI, unknown) (falling back to source compile with node-gyp)
node-pre-gyp WARN Hit error EACCES: permission denied, mkdir '/Users/me/.nvm/versions/node/v8.9.4/lib/node_modules/node/lib/node_modules/jest/node_modules/fsevents/lib'
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/Users/me/.nvm/versions/node/v8.9.4/lib/node_modules/node/lib/node_modules/jest/node_modules/fsevents/build'
gyp ERR! System Darwin 17.7.0
gyp ERR! command "/Users/me/.nvm/versions/node/v8.9.4/lib/node_modules/node/bin/node" "/Users/me/.nvm/versions/node/v8.9.4/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/Users/me/.nvm/versions/node/v8.9.4/lib/node_modules/node/lib/node_modules/jest/node_modules/fsevents/lib/binding/Release/node-v72-darwin-x64/fse.node" "--module_name=fse" "--module_path=/Users/me/.nvm/versions/node/v8.9.4/lib/node_modules/node/lib/node_modules/jest/node_modules/fsevents/lib/binding/Release/node-v72-darwin-x64" "--napi_version=4" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v72"
gyp ERR! cwd /Users/me/.nvm/versions/node/v8.9.4/lib/node_modules/node/lib/node_modules/jest/node_modules/fsevents
gyp ERR! node -v v12.2.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/Users/me/.nvm/versions/node/v8.9.4/lib/node_modules/node/bin/node /Users/me/.nvm/versions/node/v8.9.4/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/Users/me/.nvm/versions/node/v8.9.4/lib/node_modules/node/lib/node_modules/jest/node_modules/fsevents/lib/binding/Release/node-v72-darwin-x64/fse.node --module_name=fse --module_path=/Users/me/.nvm/versions/node/v8.9.4/lib/node_modules/node/lib/node_modules/jest/node_modules/fsevents/lib/binding/Release/node-v72-darwin-x64 --napi_version=4 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v72' (1)
node-pre-gyp ERR! stack at ChildProcess. (/Users/me/.nvm/versions/node/v8.9.4/lib/node_modules/node/lib/node_modules/jest/node_modules/fsevents/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:196:13)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:1011:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:268:5)
node-pre-gyp ERR! System Darwin 17.7.0
node-pre-gyp ERR! command "/Users/me/.nvm/versions/node/v8.9.4/lib/node_modules/node/bin/node" "/Users/me/.nvm/versions/node/v8.9.4/lib/node_modules/node/lib/node_modules/jest/node_modules/fsevents/node_modules/node-pre-gyp/bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /Users/me/.nvm/versions/node/v8.9.4/lib/node_modules/node/lib/node_modules/jest/node_modules/fsevents
node-pre-gyp ERR! node -v v12.2.0
node-pre-gyp ERR! node-pre-gyp -v v0.12.0
node-pre-gyp ERR! not ok
Failed to execute '/Users/me/.nvm/versions/node/v8.9.4/lib/node_modules/node/bin/node /Users/me/.nvm/versions/node/v8.9.4/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/Users/me/.nvm/versions/node/v8.9.4/lib/node_modules/node/lib/node_modules/jest/node_modules/fsevents/lib/binding/Release/node-v72-darwin-x64/fse.node --module_name=fse --module_path=/Users/me/.nvm/versions/node/v8.9.4/lib/node_modules/node/lib/node_modules/jest/node_modules/fsevents/lib/binding/Release/node-v72-darwin-x64 --napi_version=4 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v72' (1)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/jest/node_modules/fsevents):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 install: node install
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
jest@24.8.0
added 479 packages from 342 contributors in 32.465s
.grid-container.toolsetbutton
{
display: grid;
grid-template-columns: repeat(1, 50px);
/* grid-template-rows: repeat(2, 50px); */
grid-gap: 1px;
padding: 0px;
align-items: center;
}
.material-icons.toolsetbutton
{
text-align:center;
}