grid-template - why does this not fit into a single row?
up vote
0
down vote
favorite
Have got three items. Why would they not fit a in a single row with three columns
#grid
border: 1px solid black;
display: grid;
grid-template:
"a a a" 100px
#grid > div
background-color: red;
padding: 0px;
margin: 0px;
border: 1px solid black;
<div id="grid">
<div></div>
<div></div>
<div></div>
</div>
<div id="grid">
<div></div>
<div></div>
<div></div>
</div>
UPDATE: it runs as expected on SO built-in js/css/html environment.
It runs unexpectedly on both jsfiddle and codepen.
https://jsfiddle.net/97grq2pz/186/
https://codepen.io/matcheek/pen/EOgmzr
https://developer.mozilla.org/en-US/docs/Web/CSS/grid-template
css css-grid
add a comment |
up vote
0
down vote
favorite
Have got three items. Why would they not fit a in a single row with three columns
#grid
border: 1px solid black;
display: grid;
grid-template:
"a a a" 100px
#grid > div
background-color: red;
padding: 0px;
margin: 0px;
border: 1px solid black;
<div id="grid">
<div></div>
<div></div>
<div></div>
</div>
<div id="grid">
<div></div>
<div></div>
<div></div>
</div>
UPDATE: it runs as expected on SO built-in js/css/html environment.
It runs unexpectedly on both jsfiddle and codepen.
https://jsfiddle.net/97grq2pz/186/
https://codepen.io/matcheek/pen/EOgmzr
https://developer.mozilla.org/en-US/docs/Web/CSS/grid-template
css css-grid
Just checking whether css grid is mature enough to replace flexbox.
– matcheek
Nov 11 at 20:44
3
you have invisible character before and after divs considered as grid element ... remove them
– Temani Afif
Nov 11 at 21:00
Thank you!!!!!!
– matcheek
Nov 11 at 21:05
@JakubMuda you shouldn't make comments that are off-base, opinionated, and frankly not true depending on who you are and what you are doing.
– Steven B.
Nov 11 at 21:36
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
Have got three items. Why would they not fit a in a single row with three columns
#grid
border: 1px solid black;
display: grid;
grid-template:
"a a a" 100px
#grid > div
background-color: red;
padding: 0px;
margin: 0px;
border: 1px solid black;
<div id="grid">
<div></div>
<div></div>
<div></div>
</div>
<div id="grid">
<div></div>
<div></div>
<div></div>
</div>
UPDATE: it runs as expected on SO built-in js/css/html environment.
It runs unexpectedly on both jsfiddle and codepen.
https://jsfiddle.net/97grq2pz/186/
https://codepen.io/matcheek/pen/EOgmzr
https://developer.mozilla.org/en-US/docs/Web/CSS/grid-template
css css-grid
Have got three items. Why would they not fit a in a single row with three columns
#grid
border: 1px solid black;
display: grid;
grid-template:
"a a a" 100px
#grid > div
background-color: red;
padding: 0px;
margin: 0px;
border: 1px solid black;
<div id="grid">
<div></div>
<div></div>
<div></div>
</div>
<div id="grid">
<div></div>
<div></div>
<div></div>
</div>
UPDATE: it runs as expected on SO built-in js/css/html environment.
It runs unexpectedly on both jsfiddle and codepen.
https://jsfiddle.net/97grq2pz/186/
https://codepen.io/matcheek/pen/EOgmzr
https://developer.mozilla.org/en-US/docs/Web/CSS/grid-template
#grid
border: 1px solid black;
display: grid;
grid-template:
"a a a" 100px
#grid > div
background-color: red;
padding: 0px;
margin: 0px;
border: 1px solid black;
<div id="grid">
<div></div>
<div></div>
<div></div>
</div>
#grid
border: 1px solid black;
display: grid;
grid-template:
"a a a" 100px
#grid > div
background-color: red;
padding: 0px;
margin: 0px;
border: 1px solid black;
<div id="grid">
<div></div>
<div></div>
<div></div>
</div>
css css-grid
css css-grid
edited Nov 11 at 20:55
asked Nov 11 at 20:26
matcheek
2,81793554
2,81793554
Just checking whether css grid is mature enough to replace flexbox.
– matcheek
Nov 11 at 20:44
3
you have invisible character before and after divs considered as grid element ... remove them
– Temani Afif
Nov 11 at 21:00
Thank you!!!!!!
– matcheek
Nov 11 at 21:05
@JakubMuda you shouldn't make comments that are off-base, opinionated, and frankly not true depending on who you are and what you are doing.
– Steven B.
Nov 11 at 21:36
add a comment |
Just checking whether css grid is mature enough to replace flexbox.
– matcheek
Nov 11 at 20:44
3
you have invisible character before and after divs considered as grid element ... remove them
– Temani Afif
Nov 11 at 21:00
Thank you!!!!!!
– matcheek
Nov 11 at 21:05
@JakubMuda you shouldn't make comments that are off-base, opinionated, and frankly not true depending on who you are and what you are doing.
– Steven B.
Nov 11 at 21:36
Just checking whether css grid is mature enough to replace flexbox.
– matcheek
Nov 11 at 20:44
Just checking whether css grid is mature enough to replace flexbox.
– matcheek
Nov 11 at 20:44
3
3
you have invisible character before and after divs considered as grid element ... remove them
– Temani Afif
Nov 11 at 21:00
you have invisible character before and after divs considered as grid element ... remove them
– Temani Afif
Nov 11 at 21:00
Thank you!!!!!!
– matcheek
Nov 11 at 21:05
Thank you!!!!!!
– matcheek
Nov 11 at 21:05
@JakubMuda you shouldn't make comments that are off-base, opinionated, and frankly not true depending on who you are and what you are doing.
– Steven B.
Nov 11 at 21:36
@JakubMuda you shouldn't make comments that are off-base, opinionated, and frankly not true depending on who you are and what you are doing.
– Steven B.
Nov 11 at 21:36
add a comment |
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53252910%2fgrid-template-why-does-this-not-fit-into-a-single-row%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53252910%2fgrid-template-why-does-this-not-fit-into-a-single-row%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Just checking whether css grid is mature enough to replace flexbox.
– matcheek
Nov 11 at 20:44
3
you have invisible character before and after divs considered as grid element ... remove them
– Temani Afif
Nov 11 at 21:00
Thank you!!!!!!
– matcheek
Nov 11 at 21:05
@JakubMuda you shouldn't make comments that are off-base, opinionated, and frankly not true depending on who you are and what you are doing.
– Steven B.
Nov 11 at 21:36