List in CSS Grid Not Aligning as Expected [duplicate]
This question already has an answer here:
How do I remove the first empty column in a CSS grid?
2 answers
Problem / Misunderstanding:
I've created an input type="radio"
for radio choices. The radio choices should align to the left at the beginning of column 3, but instead they are in the middle, between column 3 and 4.
Expected behavior:
Radio input options should be at the beginning of column 3, under aligning with the text input bar of the Name label.
Minimal, complete and verifiable code below.
MCV.html code:
<link rel="stylesheet" href="MCP.css">
<div class="grid-container">
<form id="survey-form">
<label for="name" id="name-label">Name:</label>
<input type="text" id="name">
<div class="radio-title">
<p>Gender:</p>
</div>
<div class="radio-options">
<ul>
<li>
<input type="radio" id="choice-1">
<label for="choice-1">Option A</label>
</li>
<li>
<input type="radio" id="choice-1">
<label for="choice-1">Option B</label>
</li>
</ul>
</div>
</form>
</div>
MCV.css code:
.grid-container
display: grid;
grid-template-areas:
". . . ."
". c c ."
". . . .";
grid-template-columns: 0.7fr 1.5fr 1.5fr 0.7fr;
grid-template-rows: 0.7fr 1.5fr 0.7fr;
#survey-form
display: grid;
grid-area: c;
grid-template-columns: repeat(4, 1fr);
grid-gap: 5px;
label
grid-column: 2 / 3;
text-align: right;
input
text-align: left;
ul
list-style: none;
.radio-title
grid-column: 2;
text-align: right;
.radio-options
grid-column: 3 / 4;
text-align: left;
Here's an image with line numbers and form grid:
All feedback is appreciated, thank you!
NOTE: This issue was already answered in How do I remove the first empty column in a css grid?. Take a look at second answer.
html css html-lists css-grid
marked as duplicate by Michael_B
StackExchange.ready(function()
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();
);
);
);
Nov 15 '18 at 1:23
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
|
show 1 more comment
This question already has an answer here:
How do I remove the first empty column in a CSS grid?
2 answers
Problem / Misunderstanding:
I've created an input type="radio"
for radio choices. The radio choices should align to the left at the beginning of column 3, but instead they are in the middle, between column 3 and 4.
Expected behavior:
Radio input options should be at the beginning of column 3, under aligning with the text input bar of the Name label.
Minimal, complete and verifiable code below.
MCV.html code:
<link rel="stylesheet" href="MCP.css">
<div class="grid-container">
<form id="survey-form">
<label for="name" id="name-label">Name:</label>
<input type="text" id="name">
<div class="radio-title">
<p>Gender:</p>
</div>
<div class="radio-options">
<ul>
<li>
<input type="radio" id="choice-1">
<label for="choice-1">Option A</label>
</li>
<li>
<input type="radio" id="choice-1">
<label for="choice-1">Option B</label>
</li>
</ul>
</div>
</form>
</div>
MCV.css code:
.grid-container
display: grid;
grid-template-areas:
". . . ."
". c c ."
". . . .";
grid-template-columns: 0.7fr 1.5fr 1.5fr 0.7fr;
grid-template-rows: 0.7fr 1.5fr 0.7fr;
#survey-form
display: grid;
grid-area: c;
grid-template-columns: repeat(4, 1fr);
grid-gap: 5px;
label
grid-column: 2 / 3;
text-align: right;
input
text-align: left;
ul
list-style: none;
.radio-title
grid-column: 2;
text-align: right;
.radio-options
grid-column: 3 / 4;
text-align: left;
Here's an image with line numbers and form grid:
All feedback is appreciated, thank you!
NOTE: This issue was already answered in How do I remove the first empty column in a css grid?. Take a look at second answer.
html css html-lists css-grid
marked as duplicate by Michael_B
StackExchange.ready(function()
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();
);
);
);
Nov 15 '18 at 1:23
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
Please include your Minimal, Complete, and Verifiable example code within your question, don’t just link to it. This is to guard against link rot and to ensure that your question makes sense, and is useful, without reliance on external sites.
– David Thomas
Nov 15 '18 at 0:56
Will update it in a couple of hours, David. Sorry for my noobness.
– adriaanbd
Nov 15 '18 at 1:18
@DavidThomas I've edited the submission and presented MCV as suggested, for future users. Issue is already solved.
– adriaanbd
Nov 16 '18 at 19:36
@Michael_B issue is not a duplicate of that answer, since this is really about aligning lists in a css grid.
– adriaanbd
Nov 16 '18 at 19:36
1
@Michael_B You're right, it is a duplicate. You provided an answer to this issue already. My bad. The question was misleading and I didn't look at all of the answers.
– adriaanbd
Nov 16 '18 at 23:46
|
show 1 more comment
This question already has an answer here:
How do I remove the first empty column in a CSS grid?
2 answers
Problem / Misunderstanding:
I've created an input type="radio"
for radio choices. The radio choices should align to the left at the beginning of column 3, but instead they are in the middle, between column 3 and 4.
Expected behavior:
Radio input options should be at the beginning of column 3, under aligning with the text input bar of the Name label.
Minimal, complete and verifiable code below.
MCV.html code:
<link rel="stylesheet" href="MCP.css">
<div class="grid-container">
<form id="survey-form">
<label for="name" id="name-label">Name:</label>
<input type="text" id="name">
<div class="radio-title">
<p>Gender:</p>
</div>
<div class="radio-options">
<ul>
<li>
<input type="radio" id="choice-1">
<label for="choice-1">Option A</label>
</li>
<li>
<input type="radio" id="choice-1">
<label for="choice-1">Option B</label>
</li>
</ul>
</div>
</form>
</div>
MCV.css code:
.grid-container
display: grid;
grid-template-areas:
". . . ."
". c c ."
". . . .";
grid-template-columns: 0.7fr 1.5fr 1.5fr 0.7fr;
grid-template-rows: 0.7fr 1.5fr 0.7fr;
#survey-form
display: grid;
grid-area: c;
grid-template-columns: repeat(4, 1fr);
grid-gap: 5px;
label
grid-column: 2 / 3;
text-align: right;
input
text-align: left;
ul
list-style: none;
.radio-title
grid-column: 2;
text-align: right;
.radio-options
grid-column: 3 / 4;
text-align: left;
Here's an image with line numbers and form grid:
All feedback is appreciated, thank you!
NOTE: This issue was already answered in How do I remove the first empty column in a css grid?. Take a look at second answer.
html css html-lists css-grid
This question already has an answer here:
How do I remove the first empty column in a CSS grid?
2 answers
Problem / Misunderstanding:
I've created an input type="radio"
for radio choices. The radio choices should align to the left at the beginning of column 3, but instead they are in the middle, between column 3 and 4.
Expected behavior:
Radio input options should be at the beginning of column 3, under aligning with the text input bar of the Name label.
Minimal, complete and verifiable code below.
MCV.html code:
<link rel="stylesheet" href="MCP.css">
<div class="grid-container">
<form id="survey-form">
<label for="name" id="name-label">Name:</label>
<input type="text" id="name">
<div class="radio-title">
<p>Gender:</p>
</div>
<div class="radio-options">
<ul>
<li>
<input type="radio" id="choice-1">
<label for="choice-1">Option A</label>
</li>
<li>
<input type="radio" id="choice-1">
<label for="choice-1">Option B</label>
</li>
</ul>
</div>
</form>
</div>
MCV.css code:
.grid-container
display: grid;
grid-template-areas:
". . . ."
". c c ."
". . . .";
grid-template-columns: 0.7fr 1.5fr 1.5fr 0.7fr;
grid-template-rows: 0.7fr 1.5fr 0.7fr;
#survey-form
display: grid;
grid-area: c;
grid-template-columns: repeat(4, 1fr);
grid-gap: 5px;
label
grid-column: 2 / 3;
text-align: right;
input
text-align: left;
ul
list-style: none;
.radio-title
grid-column: 2;
text-align: right;
.radio-options
grid-column: 3 / 4;
text-align: left;
Here's an image with line numbers and form grid:
All feedback is appreciated, thank you!
NOTE: This issue was already answered in How do I remove the first empty column in a css grid?. Take a look at second answer.
This question already has an answer here:
How do I remove the first empty column in a CSS grid?
2 answers
html css html-lists css-grid
html css html-lists css-grid
edited Nov 16 '18 at 23:49
adriaanbd
asked Nov 15 '18 at 0:32
adriaanbdadriaanbd
207
207
marked as duplicate by Michael_B
StackExchange.ready(function()
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();
);
);
);
Nov 15 '18 at 1:23
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
marked as duplicate by Michael_B
StackExchange.ready(function()
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();
);
);
);
Nov 15 '18 at 1:23
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
Please include your Minimal, Complete, and Verifiable example code within your question, don’t just link to it. This is to guard against link rot and to ensure that your question makes sense, and is useful, without reliance on external sites.
– David Thomas
Nov 15 '18 at 0:56
Will update it in a couple of hours, David. Sorry for my noobness.
– adriaanbd
Nov 15 '18 at 1:18
@DavidThomas I've edited the submission and presented MCV as suggested, for future users. Issue is already solved.
– adriaanbd
Nov 16 '18 at 19:36
@Michael_B issue is not a duplicate of that answer, since this is really about aligning lists in a css grid.
– adriaanbd
Nov 16 '18 at 19:36
1
@Michael_B You're right, it is a duplicate. You provided an answer to this issue already. My bad. The question was misleading and I didn't look at all of the answers.
– adriaanbd
Nov 16 '18 at 23:46
|
show 1 more comment
Please include your Minimal, Complete, and Verifiable example code within your question, don’t just link to it. This is to guard against link rot and to ensure that your question makes sense, and is useful, without reliance on external sites.
– David Thomas
Nov 15 '18 at 0:56
Will update it in a couple of hours, David. Sorry for my noobness.
– adriaanbd
Nov 15 '18 at 1:18
@DavidThomas I've edited the submission and presented MCV as suggested, for future users. Issue is already solved.
– adriaanbd
Nov 16 '18 at 19:36
@Michael_B issue is not a duplicate of that answer, since this is really about aligning lists in a css grid.
– adriaanbd
Nov 16 '18 at 19:36
1
@Michael_B You're right, it is a duplicate. You provided an answer to this issue already. My bad. The question was misleading and I didn't look at all of the answers.
– adriaanbd
Nov 16 '18 at 23:46
Please include your Minimal, Complete, and Verifiable example code within your question, don’t just link to it. This is to guard against link rot and to ensure that your question makes sense, and is useful, without reliance on external sites.
– David Thomas
Nov 15 '18 at 0:56
Please include your Minimal, Complete, and Verifiable example code within your question, don’t just link to it. This is to guard against link rot and to ensure that your question makes sense, and is useful, without reliance on external sites.
– David Thomas
Nov 15 '18 at 0:56
Will update it in a couple of hours, David. Sorry for my noobness.
– adriaanbd
Nov 15 '18 at 1:18
Will update it in a couple of hours, David. Sorry for my noobness.
– adriaanbd
Nov 15 '18 at 1:18
@DavidThomas I've edited the submission and presented MCV as suggested, for future users. Issue is already solved.
– adriaanbd
Nov 16 '18 at 19:36
@DavidThomas I've edited the submission and presented MCV as suggested, for future users. Issue is already solved.
– adriaanbd
Nov 16 '18 at 19:36
@Michael_B issue is not a duplicate of that answer, since this is really about aligning lists in a css grid.
– adriaanbd
Nov 16 '18 at 19:36
@Michael_B issue is not a duplicate of that answer, since this is really about aligning lists in a css grid.
– adriaanbd
Nov 16 '18 at 19:36
1
1
@Michael_B You're right, it is a duplicate. You provided an answer to this issue already. My bad. The question was misleading and I didn't look at all of the answers.
– adriaanbd
Nov 16 '18 at 23:46
@Michael_B You're right, it is a duplicate. You provided an answer to this issue already. My bad. The question was misleading and I didn't look at all of the answers.
– adriaanbd
Nov 16 '18 at 23:46
|
show 1 more comment
1 Answer
1
active
oldest
votes
I believe this is more of a List issue. Most browsers attach some sort of padding / margin to an element so most people clear these out before starting on a new page.
Going to your codepen use:
//css
.gender ul
padding: 0;
and you'll see the buttons move over to your desired location.
Thank you, that solved my immediate problem!
– adriaanbd
Nov 15 '18 at 5:06
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
I believe this is more of a List issue. Most browsers attach some sort of padding / margin to an element so most people clear these out before starting on a new page.
Going to your codepen use:
//css
.gender ul
padding: 0;
and you'll see the buttons move over to your desired location.
Thank you, that solved my immediate problem!
– adriaanbd
Nov 15 '18 at 5:06
add a comment |
I believe this is more of a List issue. Most browsers attach some sort of padding / margin to an element so most people clear these out before starting on a new page.
Going to your codepen use:
//css
.gender ul
padding: 0;
and you'll see the buttons move over to your desired location.
Thank you, that solved my immediate problem!
– adriaanbd
Nov 15 '18 at 5:06
add a comment |
I believe this is more of a List issue. Most browsers attach some sort of padding / margin to an element so most people clear these out before starting on a new page.
Going to your codepen use:
//css
.gender ul
padding: 0;
and you'll see the buttons move over to your desired location.
I believe this is more of a List issue. Most browsers attach some sort of padding / margin to an element so most people clear these out before starting on a new page.
Going to your codepen use:
//css
.gender ul
padding: 0;
and you'll see the buttons move over to your desired location.
answered Nov 15 '18 at 0:44
Robert PerezRobert Perez
12210
12210
Thank you, that solved my immediate problem!
– adriaanbd
Nov 15 '18 at 5:06
add a comment |
Thank you, that solved my immediate problem!
– adriaanbd
Nov 15 '18 at 5:06
Thank you, that solved my immediate problem!
– adriaanbd
Nov 15 '18 at 5:06
Thank you, that solved my immediate problem!
– adriaanbd
Nov 15 '18 at 5:06
add a comment |
Please include your Minimal, Complete, and Verifiable example code within your question, don’t just link to it. This is to guard against link rot and to ensure that your question makes sense, and is useful, without reliance on external sites.
– David Thomas
Nov 15 '18 at 0:56
Will update it in a couple of hours, David. Sorry for my noobness.
– adriaanbd
Nov 15 '18 at 1:18
@DavidThomas I've edited the submission and presented MCV as suggested, for future users. Issue is already solved.
– adriaanbd
Nov 16 '18 at 19:36
@Michael_B issue is not a duplicate of that answer, since this is really about aligning lists in a css grid.
– adriaanbd
Nov 16 '18 at 19:36
1
@Michael_B You're right, it is a duplicate. You provided an answer to this issue already. My bad. The question was misleading and I didn't look at all of the answers.
– adriaanbd
Nov 16 '18 at 23:46