How to set the size of the bootstrap text and card size











up vote
0
down vote

favorite












I have the card implemented using bootstrap. But my card size is varying according to the quantity of the text characters.
Details link is varying as well, and when i shrink the browser, it overlap my card text.
How to fix the size of the card text (class: card-text) to avoid the overlap and to avoid different cards size?



<div class="card">
<div class="img-dimension">
<img class="card-img-top" src="img.jpg">
</div>
<div class="card-body">
<h5 class="card-title">title</h5>
<div class="card-text">
<p>
My long card-text....Phasellus a est. Nam eget dui.
Pellentesque ut neque. Nunc sed turpis. Donec mi odio,
faucibus at, scelerisque quis, convallis in, nisi.
</p>
</div>
<div class="text-left pb-2 pt-2">
<a href="#">Details...</a>
</div>
</div>
</div>


My CSS code. I didn't change this bootstrap CSS Code:



.card {
position: relative;
display: flex;
flex-direction: column;
min-width: 0;
word-wrap: break-word;
background-color: #fff;
background-clip: border-box;
border: 1px solid rgba(0,0,0,.125);
border-radius: .25rem;
}

.card-body {
flex: 1 1 auto;
padding: 1.25rem;
}

.card-title {
margin-bottom: .75rem;
}

.card-img-top {
width: 100%;
border-top-left-radius: calc(.25rem - 1px);
border-top-right-radius: calc(.25rem - 1px);
}

.text-left {
text-align: left!important;
}
.pb-2, .py-2 {
padding-bottom: .5rem!important;
}
.pt-2, .py-2 {
padding-top: .5rem!important;
}









share|improve this question


























    up vote
    0
    down vote

    favorite












    I have the card implemented using bootstrap. But my card size is varying according to the quantity of the text characters.
    Details link is varying as well, and when i shrink the browser, it overlap my card text.
    How to fix the size of the card text (class: card-text) to avoid the overlap and to avoid different cards size?



    <div class="card">
    <div class="img-dimension">
    <img class="card-img-top" src="img.jpg">
    </div>
    <div class="card-body">
    <h5 class="card-title">title</h5>
    <div class="card-text">
    <p>
    My long card-text....Phasellus a est. Nam eget dui.
    Pellentesque ut neque. Nunc sed turpis. Donec mi odio,
    faucibus at, scelerisque quis, convallis in, nisi.
    </p>
    </div>
    <div class="text-left pb-2 pt-2">
    <a href="#">Details...</a>
    </div>
    </div>
    </div>


    My CSS code. I didn't change this bootstrap CSS Code:



    .card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    word-wrap: break-word;
    background-color: #fff;
    background-clip: border-box;
    border: 1px solid rgba(0,0,0,.125);
    border-radius: .25rem;
    }

    .card-body {
    flex: 1 1 auto;
    padding: 1.25rem;
    }

    .card-title {
    margin-bottom: .75rem;
    }

    .card-img-top {
    width: 100%;
    border-top-left-radius: calc(.25rem - 1px);
    border-top-right-radius: calc(.25rem - 1px);
    }

    .text-left {
    text-align: left!important;
    }
    .pb-2, .py-2 {
    padding-bottom: .5rem!important;
    }
    .pt-2, .py-2 {
    padding-top: .5rem!important;
    }









    share|improve this question
























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I have the card implemented using bootstrap. But my card size is varying according to the quantity of the text characters.
      Details link is varying as well, and when i shrink the browser, it overlap my card text.
      How to fix the size of the card text (class: card-text) to avoid the overlap and to avoid different cards size?



      <div class="card">
      <div class="img-dimension">
      <img class="card-img-top" src="img.jpg">
      </div>
      <div class="card-body">
      <h5 class="card-title">title</h5>
      <div class="card-text">
      <p>
      My long card-text....Phasellus a est. Nam eget dui.
      Pellentesque ut neque. Nunc sed turpis. Donec mi odio,
      faucibus at, scelerisque quis, convallis in, nisi.
      </p>
      </div>
      <div class="text-left pb-2 pt-2">
      <a href="#">Details...</a>
      </div>
      </div>
      </div>


      My CSS code. I didn't change this bootstrap CSS Code:



      .card {
      position: relative;
      display: flex;
      flex-direction: column;
      min-width: 0;
      word-wrap: break-word;
      background-color: #fff;
      background-clip: border-box;
      border: 1px solid rgba(0,0,0,.125);
      border-radius: .25rem;
      }

      .card-body {
      flex: 1 1 auto;
      padding: 1.25rem;
      }

      .card-title {
      margin-bottom: .75rem;
      }

      .card-img-top {
      width: 100%;
      border-top-left-radius: calc(.25rem - 1px);
      border-top-right-radius: calc(.25rem - 1px);
      }

      .text-left {
      text-align: left!important;
      }
      .pb-2, .py-2 {
      padding-bottom: .5rem!important;
      }
      .pt-2, .py-2 {
      padding-top: .5rem!important;
      }









      share|improve this question













      I have the card implemented using bootstrap. But my card size is varying according to the quantity of the text characters.
      Details link is varying as well, and when i shrink the browser, it overlap my card text.
      How to fix the size of the card text (class: card-text) to avoid the overlap and to avoid different cards size?



      <div class="card">
      <div class="img-dimension">
      <img class="card-img-top" src="img.jpg">
      </div>
      <div class="card-body">
      <h5 class="card-title">title</h5>
      <div class="card-text">
      <p>
      My long card-text....Phasellus a est. Nam eget dui.
      Pellentesque ut neque. Nunc sed turpis. Donec mi odio,
      faucibus at, scelerisque quis, convallis in, nisi.
      </p>
      </div>
      <div class="text-left pb-2 pt-2">
      <a href="#">Details...</a>
      </div>
      </div>
      </div>


      My CSS code. I didn't change this bootstrap CSS Code:



      .card {
      position: relative;
      display: flex;
      flex-direction: column;
      min-width: 0;
      word-wrap: break-word;
      background-color: #fff;
      background-clip: border-box;
      border: 1px solid rgba(0,0,0,.125);
      border-radius: .25rem;
      }

      .card-body {
      flex: 1 1 auto;
      padding: 1.25rem;
      }

      .card-title {
      margin-bottom: .75rem;
      }

      .card-img-top {
      width: 100%;
      border-top-left-radius: calc(.25rem - 1px);
      border-top-right-radius: calc(.25rem - 1px);
      }

      .text-left {
      text-align: left!important;
      }
      .pb-2, .py-2 {
      padding-bottom: .5rem!important;
      }
      .pt-2, .py-2 {
      padding-top: .5rem!important;
      }






      css twitter-bootstrap






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 7 at 10:01









      mr.abdo

      53




      53
























          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote



          accepted










          Text-Overflow



          This might help you, you can use it to control the overflow of your text according to your needs.



          For example:



           .card-text{
          font-size:19px;
          text-overflow: ellipsis;
          white-space: nowrap;
          overflow: hidden;
          }


          If you wish to make your website responsive you should try using @media rule
          in which you can specify the exact changes according to the resolution.



          Have a look at this link for @media rule.



          For example: -->Hide an element when the browser's width is 600px wide or less:



             @media screen and (max-width: 600px) {
          div.example {
          display: none;
          }
          }


          I hope this can help you.






          share|improve this answer























            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
            });


            }
            });














             

            draft saved


            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53187180%2fhow-to-set-the-size-of-the-bootstrap-text-and-card-size%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








            up vote
            0
            down vote



            accepted










            Text-Overflow



            This might help you, you can use it to control the overflow of your text according to your needs.



            For example:



             .card-text{
            font-size:19px;
            text-overflow: ellipsis;
            white-space: nowrap;
            overflow: hidden;
            }


            If you wish to make your website responsive you should try using @media rule
            in which you can specify the exact changes according to the resolution.



            Have a look at this link for @media rule.



            For example: -->Hide an element when the browser's width is 600px wide or less:



               @media screen and (max-width: 600px) {
            div.example {
            display: none;
            }
            }


            I hope this can help you.






            share|improve this answer



























              up vote
              0
              down vote



              accepted










              Text-Overflow



              This might help you, you can use it to control the overflow of your text according to your needs.



              For example:



               .card-text{
              font-size:19px;
              text-overflow: ellipsis;
              white-space: nowrap;
              overflow: hidden;
              }


              If you wish to make your website responsive you should try using @media rule
              in which you can specify the exact changes according to the resolution.



              Have a look at this link for @media rule.



              For example: -->Hide an element when the browser's width is 600px wide or less:



                 @media screen and (max-width: 600px) {
              div.example {
              display: none;
              }
              }


              I hope this can help you.






              share|improve this answer

























                up vote
                0
                down vote



                accepted







                up vote
                0
                down vote



                accepted






                Text-Overflow



                This might help you, you can use it to control the overflow of your text according to your needs.



                For example:



                 .card-text{
                font-size:19px;
                text-overflow: ellipsis;
                white-space: nowrap;
                overflow: hidden;
                }


                If you wish to make your website responsive you should try using @media rule
                in which you can specify the exact changes according to the resolution.



                Have a look at this link for @media rule.



                For example: -->Hide an element when the browser's width is 600px wide or less:



                   @media screen and (max-width: 600px) {
                div.example {
                display: none;
                }
                }


                I hope this can help you.






                share|improve this answer














                Text-Overflow



                This might help you, you can use it to control the overflow of your text according to your needs.



                For example:



                 .card-text{
                font-size:19px;
                text-overflow: ellipsis;
                white-space: nowrap;
                overflow: hidden;
                }


                If you wish to make your website responsive you should try using @media rule
                in which you can specify the exact changes according to the resolution.



                Have a look at this link for @media rule.



                For example: -->Hide an element when the browser's width is 600px wide or less:



                   @media screen and (max-width: 600px) {
                div.example {
                display: none;
                }
                }


                I hope this can help you.







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Nov 7 at 10:43

























                answered Nov 7 at 10:23









                mkyriacou1994

                244




                244






























                     

                    draft saved


                    draft discarded



















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53187180%2fhow-to-set-the-size-of-the-bootstrap-text-and-card-size%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







                    這個網誌中的熱門文章

                    Tangent Lines Diagram Along Smooth Curve

                    Yusuf al-Mu'taman ibn Hud

                    Zucchini