Reducing the width of a column and understanding css used












0















I am looking at a react code with material UI and trying to understand
the className used like below.



Can you explain these two lines please? I thought you can only have a maximum of 12 columns.



            <div className="col-xs-12 col-sm-6 col-md-6 col-lg-6 ">
<div className="col-xs-12 col-sm-12 col-md-12 col-lg-12">


I want to reduce the width of the Invoice covered and Reason for credit
which means reducing the width of the column. How can I achieve this?



            <div className="row customer-form-layout">
<div className="col-xs-12 col-sm-6 col-md-6 col-lg-6 ">
<div className="customer-form-details">
<span>{this.props.customer.CustomerName}</span><br/>
<span>Customer #: <b>{this.props.customer.biCustomerNumber }</b></span>
</div>

<div className="covered-section">
<div className="row">
<div className="col-xs-12 col-sm-12 col-md-12 col-lg-12">

<FormControl className="form-control">
<InputLabel htmlFor="invoice-number01" shrink>Invoice
Covered*</InputLabel>
<Select
value=''
inputProps={{
name: 'Test-number02',
id: 'Test-number02',
}}
>
<MenuItem value='1234567890'>1234567890</MenuItem>
<MenuItem value='2345678901'>2345678901</MenuItem>
</Select>

</FormControl>
</div>

</div>
</div>
<FormControl fullWidth className="form-control">
<InputLabel htmlFor="reason-field-value" shrink>Reason for Credit
</InputLabel>
<TextField
id="reason-field-value"
multiline
rows="8"
margin="normal"
/>
</FormControl>
</div>









share|improve this question

























  • First of all, your component contains way too much information. Try to split your code into smaller components, that are easier to maintain. (For example, extract the details into it's own component). Regarding the cols: You can define different width for each viewport. col-xs-12 col-sm-6 = 12 cols in viewport xs, 6 cols in viewport sm

    – dschu
    Jan 2 at 16:10
















0















I am looking at a react code with material UI and trying to understand
the className used like below.



Can you explain these two lines please? I thought you can only have a maximum of 12 columns.



            <div className="col-xs-12 col-sm-6 col-md-6 col-lg-6 ">
<div className="col-xs-12 col-sm-12 col-md-12 col-lg-12">


I want to reduce the width of the Invoice covered and Reason for credit
which means reducing the width of the column. How can I achieve this?



            <div className="row customer-form-layout">
<div className="col-xs-12 col-sm-6 col-md-6 col-lg-6 ">
<div className="customer-form-details">
<span>{this.props.customer.CustomerName}</span><br/>
<span>Customer #: <b>{this.props.customer.biCustomerNumber }</b></span>
</div>

<div className="covered-section">
<div className="row">
<div className="col-xs-12 col-sm-12 col-md-12 col-lg-12">

<FormControl className="form-control">
<InputLabel htmlFor="invoice-number01" shrink>Invoice
Covered*</InputLabel>
<Select
value=''
inputProps={{
name: 'Test-number02',
id: 'Test-number02',
}}
>
<MenuItem value='1234567890'>1234567890</MenuItem>
<MenuItem value='2345678901'>2345678901</MenuItem>
</Select>

</FormControl>
</div>

</div>
</div>
<FormControl fullWidth className="form-control">
<InputLabel htmlFor="reason-field-value" shrink>Reason for Credit
</InputLabel>
<TextField
id="reason-field-value"
multiline
rows="8"
margin="normal"
/>
</FormControl>
</div>









share|improve this question

























  • First of all, your component contains way too much information. Try to split your code into smaller components, that are easier to maintain. (For example, extract the details into it's own component). Regarding the cols: You can define different width for each viewport. col-xs-12 col-sm-6 = 12 cols in viewport xs, 6 cols in viewport sm

    – dschu
    Jan 2 at 16:10














0












0








0








I am looking at a react code with material UI and trying to understand
the className used like below.



Can you explain these two lines please? I thought you can only have a maximum of 12 columns.



            <div className="col-xs-12 col-sm-6 col-md-6 col-lg-6 ">
<div className="col-xs-12 col-sm-12 col-md-12 col-lg-12">


I want to reduce the width of the Invoice covered and Reason for credit
which means reducing the width of the column. How can I achieve this?



            <div className="row customer-form-layout">
<div className="col-xs-12 col-sm-6 col-md-6 col-lg-6 ">
<div className="customer-form-details">
<span>{this.props.customer.CustomerName}</span><br/>
<span>Customer #: <b>{this.props.customer.biCustomerNumber }</b></span>
</div>

<div className="covered-section">
<div className="row">
<div className="col-xs-12 col-sm-12 col-md-12 col-lg-12">

<FormControl className="form-control">
<InputLabel htmlFor="invoice-number01" shrink>Invoice
Covered*</InputLabel>
<Select
value=''
inputProps={{
name: 'Test-number02',
id: 'Test-number02',
}}
>
<MenuItem value='1234567890'>1234567890</MenuItem>
<MenuItem value='2345678901'>2345678901</MenuItem>
</Select>

</FormControl>
</div>

</div>
</div>
<FormControl fullWidth className="form-control">
<InputLabel htmlFor="reason-field-value" shrink>Reason for Credit
</InputLabel>
<TextField
id="reason-field-value"
multiline
rows="8"
margin="normal"
/>
</FormControl>
</div>









share|improve this question
















I am looking at a react code with material UI and trying to understand
the className used like below.



Can you explain these two lines please? I thought you can only have a maximum of 12 columns.



            <div className="col-xs-12 col-sm-6 col-md-6 col-lg-6 ">
<div className="col-xs-12 col-sm-12 col-md-12 col-lg-12">


I want to reduce the width of the Invoice covered and Reason for credit
which means reducing the width of the column. How can I achieve this?



            <div className="row customer-form-layout">
<div className="col-xs-12 col-sm-6 col-md-6 col-lg-6 ">
<div className="customer-form-details">
<span>{this.props.customer.CustomerName}</span><br/>
<span>Customer #: <b>{this.props.customer.biCustomerNumber }</b></span>
</div>

<div className="covered-section">
<div className="row">
<div className="col-xs-12 col-sm-12 col-md-12 col-lg-12">

<FormControl className="form-control">
<InputLabel htmlFor="invoice-number01" shrink>Invoice
Covered*</InputLabel>
<Select
value=''
inputProps={{
name: 'Test-number02',
id: 'Test-number02',
}}
>
<MenuItem value='1234567890'>1234567890</MenuItem>
<MenuItem value='2345678901'>2345678901</MenuItem>
</Select>

</FormControl>
</div>

</div>
</div>
<FormControl fullWidth className="form-control">
<InputLabel htmlFor="reason-field-value" shrink>Reason for Credit
</InputLabel>
<TextField
id="reason-field-value"
multiline
rows="8"
margin="normal"
/>
</FormControl>
</div>






twitter-bootstrap-3 material-ui






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 2 at 16:05









dschu

2,39821936




2,39821936










asked Jan 2 at 16:00









user2320476user2320476

50011440




50011440













  • First of all, your component contains way too much information. Try to split your code into smaller components, that are easier to maintain. (For example, extract the details into it's own component). Regarding the cols: You can define different width for each viewport. col-xs-12 col-sm-6 = 12 cols in viewport xs, 6 cols in viewport sm

    – dschu
    Jan 2 at 16:10



















  • First of all, your component contains way too much information. Try to split your code into smaller components, that are easier to maintain. (For example, extract the details into it's own component). Regarding the cols: You can define different width for each viewport. col-xs-12 col-sm-6 = 12 cols in viewport xs, 6 cols in viewport sm

    – dschu
    Jan 2 at 16:10

















First of all, your component contains way too much information. Try to split your code into smaller components, that are easier to maintain. (For example, extract the details into it's own component). Regarding the cols: You can define different width for each viewport. col-xs-12 col-sm-6 = 12 cols in viewport xs, 6 cols in viewport sm

– dschu
Jan 2 at 16:10





First of all, your component contains way too much information. Try to split your code into smaller components, that are easier to maintain. (For example, extract the details into it's own component). Regarding the cols: You can define different width for each viewport. col-xs-12 col-sm-6 = 12 cols in viewport xs, 6 cols in viewport sm

– dschu
Jan 2 at 16:10












1 Answer
1






active

oldest

votes


















1














For bootstrap 3, a col-xs-12 class means, below xs (<768px), the element will take 12 columns.



While col-sm-6, means above sm (≥768px), it will take up 6 columns.



Therefore, this div



<div className="col-xs-12 col-sm-6 col-md-6 col-lg-6 ">


will take full width below 768px. However, when it reaches 768px and above, it will take 50% width.



Which also means, it is completely equivalent to this:



<div className="col-xs-12 col-sm-6">




Reference: https://getbootstrap.com/docs/3.4/css/#grid-options






share|improve this answer


























  • Great. How do I now reduce the width of this column?

    – user2320476
    Jan 2 at 17:04











  • A full 12-columns width would be the width of .covered-section div. Adjust the width of that class. Unless you can actually provide me with the CSS, or else I can't actually provide the exact solution.

    – Liren Yeo
    Jan 2 at 17:22











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',
autoActivateHeartbeat: false,
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
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54009408%2freducing-the-width-of-a-column-and-understanding-css-used%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









1














For bootstrap 3, a col-xs-12 class means, below xs (<768px), the element will take 12 columns.



While col-sm-6, means above sm (≥768px), it will take up 6 columns.



Therefore, this div



<div className="col-xs-12 col-sm-6 col-md-6 col-lg-6 ">


will take full width below 768px. However, when it reaches 768px and above, it will take 50% width.



Which also means, it is completely equivalent to this:



<div className="col-xs-12 col-sm-6">




Reference: https://getbootstrap.com/docs/3.4/css/#grid-options






share|improve this answer


























  • Great. How do I now reduce the width of this column?

    – user2320476
    Jan 2 at 17:04











  • A full 12-columns width would be the width of .covered-section div. Adjust the width of that class. Unless you can actually provide me with the CSS, or else I can't actually provide the exact solution.

    – Liren Yeo
    Jan 2 at 17:22
















1














For bootstrap 3, a col-xs-12 class means, below xs (<768px), the element will take 12 columns.



While col-sm-6, means above sm (≥768px), it will take up 6 columns.



Therefore, this div



<div className="col-xs-12 col-sm-6 col-md-6 col-lg-6 ">


will take full width below 768px. However, when it reaches 768px and above, it will take 50% width.



Which also means, it is completely equivalent to this:



<div className="col-xs-12 col-sm-6">




Reference: https://getbootstrap.com/docs/3.4/css/#grid-options






share|improve this answer


























  • Great. How do I now reduce the width of this column?

    – user2320476
    Jan 2 at 17:04











  • A full 12-columns width would be the width of .covered-section div. Adjust the width of that class. Unless you can actually provide me with the CSS, or else I can't actually provide the exact solution.

    – Liren Yeo
    Jan 2 at 17:22














1












1








1







For bootstrap 3, a col-xs-12 class means, below xs (<768px), the element will take 12 columns.



While col-sm-6, means above sm (≥768px), it will take up 6 columns.



Therefore, this div



<div className="col-xs-12 col-sm-6 col-md-6 col-lg-6 ">


will take full width below 768px. However, when it reaches 768px and above, it will take 50% width.



Which also means, it is completely equivalent to this:



<div className="col-xs-12 col-sm-6">




Reference: https://getbootstrap.com/docs/3.4/css/#grid-options






share|improve this answer















For bootstrap 3, a col-xs-12 class means, below xs (<768px), the element will take 12 columns.



While col-sm-6, means above sm (≥768px), it will take up 6 columns.



Therefore, this div



<div className="col-xs-12 col-sm-6 col-md-6 col-lg-6 ">


will take full width below 768px. However, when it reaches 768px and above, it will take 50% width.



Which also means, it is completely equivalent to this:



<div className="col-xs-12 col-sm-6">




Reference: https://getbootstrap.com/docs/3.4/css/#grid-options







share|improve this answer














share|improve this answer



share|improve this answer








edited Jan 2 at 16:50

























answered Jan 2 at 16:45









Liren YeoLiren Yeo

1,1701520




1,1701520













  • Great. How do I now reduce the width of this column?

    – user2320476
    Jan 2 at 17:04











  • A full 12-columns width would be the width of .covered-section div. Adjust the width of that class. Unless you can actually provide me with the CSS, or else I can't actually provide the exact solution.

    – Liren Yeo
    Jan 2 at 17:22



















  • Great. How do I now reduce the width of this column?

    – user2320476
    Jan 2 at 17:04











  • A full 12-columns width would be the width of .covered-section div. Adjust the width of that class. Unless you can actually provide me with the CSS, or else I can't actually provide the exact solution.

    – Liren Yeo
    Jan 2 at 17:22

















Great. How do I now reduce the width of this column?

– user2320476
Jan 2 at 17:04





Great. How do I now reduce the width of this column?

– user2320476
Jan 2 at 17:04













A full 12-columns width would be the width of .covered-section div. Adjust the width of that class. Unless you can actually provide me with the CSS, or else I can't actually provide the exact solution.

– Liren Yeo
Jan 2 at 17:22





A full 12-columns width would be the width of .covered-section div. Adjust the width of that class. Unless you can actually provide me with the CSS, or else I can't actually provide the exact solution.

– Liren Yeo
Jan 2 at 17:22




















draft saved

draft discarded




















































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.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54009408%2freducing-the-width-of-a-column-and-understanding-css-used%23new-answer', 'question_page');
}
);

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







Popular posts from this blog

MongoDB - Not Authorized To Execute Command

How to fix TextFormField cause rebuild widget in Flutter

in spring boot 2.1 many test slices are not allowed anymore due to multiple @BootstrapWith