Home > Software design >  Text height not filling card
Text height not filling card

Time:06-05

Can't understand why the text inside my card is not expanding to the height I want. Find my code bellow in order to understand what I am doing wrong. I've tried everything, but I can't really get why this is not expanding without interfere in the size I want.

This is the part of the card I want to fill with text (in orange): enter image description here

* {
    margin:0;
    box-sizing: border-box;
    font-family: "Encode Sans", sans-serif;
}

.container {
    width: 100%;
}

section {
    padding: .1em;
}

.row {
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
}

.column {
    float: left;
    width: 50%;
    padding: 0 10px;
}

.card {
    height: 100%;
    padding: 5em 2em;
    text-align: left;
    background: linear-gradient(0deg, #ff6500 6px, transparent 1px);
    background-repeat: no-repeat;
    background-position: 0 0.62em;
    box-shadow: 0 0 .5em rgba(0, 0, 0, 5);
    border-radius: 1em;
    transition: 0.5s;
}

.card h3 {
    font-size: 1.1em;
    margin: 1.5em 0 1em 0;
    font-weight: 600;
    letter-spacing: 1px;
    color: #070024;
    text-align: center;
}

.card .textadm {
    line-height: 2.2em;
    color: #625a71;
    height: 580px;
}

.card .scroll-bg {
    background-color: white;
    width: 100%;
    padding-bottom: 5px;
}

.card .scroll-div {
    width: 102%;
    background-color: white;
    height: px;
    overflow: hidden;
    overflow-y: scroll;
}

    .card .scroll-div::-webkit-scrollbar {
        width: 3px;
    }

    .card .scroll-div::-webkit-scrollbar-track {
        -webkit-box-shadow: inset 0 0 8px #fff;
    }

    .card .scroll-div::-webkit-scrollbar-thumb {
        background-color: #625a71;
    }

.card .scroll-object {
    line-height: 1em;
    color: #625a71;
    height:580px;
}
<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title>Test</title>

    <link href="style.css" rel="stylesheet" />
</head>

    <body>
        <div >
            <section>
                <div >
                    <div >
                        <div >
                            <h3>Message</h3>
                            <div >
                                <div >
                                    <div >
                                        <p >
                                            <span lang="EN-US" style="line-height:120%">
                                                Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.

                        The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum" by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham. 
                        Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.

                        The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum" by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham. 
                        Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.

                        The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum" by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham. 
                        Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.

                        The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum" by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham. 
                                            </span>
                                        </p>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </section>
        </div>
    </body>
</html>

CodePudding user response:

* {
  margin: 0;
  box-sizing: border-box;
  font-family: "Encode Sans", sans-serif;
}

.container {
  width: 100%;
}

section {
  padding: .1em;
}

.row {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
}

.column {
  float: left;
  width: 50%;
  padding: 0 10px;
}

.card {
  height: 100%;
  padding: 3em 2rem;
  text-align: left;
  background: linear-gradient(0deg, #ff6500 6px, transparent 1px);
  background-repeat: no-repeat;
  background-position: 0 0.62em;
  box-shadow: 0 0 .5em rgba(0, 0, 0, 5);
  border-radius: 1em;
  transition: 0.5s;
}

.card h3 {
  font-size: 1.1em;
  margin: 1.5em 0 1em 0;
  font-weight: 600;
  letter-spacing: 1px;
  color: #070024;
  text-align: center;
}

.card .textadm {
  line-height: 2.2em;
  color: #625a71;
  height: 580px;
}

.card .scroll-bg {
  background-color: white;
  width: 100%;
  padding-bottom: 5px;
}

.card .scroll-div {
  width: 102%;
  background-color: white;
  /* height: px; */
  overflow: hidden;
  overflow-y: scroll;
  border: 2px solid orange;
  /*Here is what you have to add*/
  padding: 10px;
}

.card .scroll-div::-webkit-scrollbar {
  width: 3px;
}

.card .scroll-div::-webkit-scrollbar-track {
  -webkit-box-shadow: inset 0 0 8px #fff;
}

.card .scroll-div::-webkit-scrollbar-thumb {
  background-color: #625a71;
}

.card .scroll-object {
  line-height: 1em;
  color: #625a71;
  height: 580px;
}

CodePudding user response:

@Rekcs. I think it's due to padding-bottom of card element. Please try to reduce it. Hope this helps. Happy coding~ :)

CodePudding user response:

Just add padding-bottom: 10px; to .card, or whatever spacing you want.

  • Related