Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to get header text and body text inline with each other

I have two headers and two paragraphs. But the first item of the paragraph is outlined over the other lines:

Header

  waspeen: 3304.07
ananas: 24
appel: 3962.0

Header

  waspeen: 3304.07
ananas: 30
appel: 3962.0

So how to get everything in line with each other?

so that it will look like:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Header                     Header

waspeen: 3304.07           waspeen: 3304.07
ananas: 30                 ananas: 24
appel: 3962.0              appel: 3962.0

this is css:

#gallery-text-left {
    /* Added */
    width: 50%;
}
#gallery-paragraph-1 {
    margin-right: 50px;
    border-radius: 50px;
    padding-left: 50px;
  display: inline;
    /* Added */
    
}
#gallery-paragraph-2 {
    margin-right: 50px;
    border-radius: 4px;
    padding-left: 50px;
  display: inline;
}

#gallery-text-right {
    /* Added */
    width: 50%;
}

and html:

<!DOCTYPE html>
<html lang="en">

    <head>
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>Document</title>
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
        <link rel="stylesheet" type="text/css" href="{% static 'main/css/custom-style.css' %}" />
        <link rel="stylesheet" type="text/css" href="{% static 'main/css/bootstrap.css' %}" />
    </head>

    <body>

        <div class="container center">
            <div id="gallery-text">

                <div id="gallery-text-left" style="float:left">
                    <p id="gallery-text-quote-left" style="font-family:Century Gothic; color:#006600"><b> Header</b></p>

                    <p id="gallery-paragraph-1" style="font-family:Georgia">

                        {% for key, value in content %}
                        <span {% if key in diff_set %} style="color: red;" {% endif %}>{{ key }}: {{value}}</span><br>
                        {% endfor %}
                    </p>
                </div>


                <div id="gallery-text-right" style="float:left">
                    <p id="gallery-text-quote-right" style="font-family:Century Gothic; color:#006600"><b>Header</b></p>
                    <p id="gallery-paragraph-2" style="font-family:Georgia">
                        {% for key, value in content_excel %}
                        <span {% if key in diff_set %} style="color: red;" {% endif %}>{{ key }}: {{value}}</span><br>
                        {% endfor %}
                    </p>
                </div>
            </div>
        </div>
    </body>

</html>

>Solution :

you are looking for flexbox, or alternatively you could use grid, the following code should work.

#gallery-text-left {
  /* Added */
  width: 50%;
  display: flex;
  flex-direction: column;
}

#gallery-text {
  /* Added */
  width: 100%;
  display: flex;
}

#gallery-paragraph-1 {
  border-radius: 50px;
  display: flex;
  flex-direction: column;
}

#gallery-paragraph-2 {
  border-radius: 4px;
  display: flex;
  flex-direction: column;
}

#gallery-text-right {
  /* Added */
  display: flex;
  flex-direction: column;
  width: 50%;
}
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
  <link rel="stylesheet" type="text/css" href="{% static 'main/css/custom-style.css' %}" />
  <link rel="stylesheet" type="text/css" href="{% static 'main/css/bootstrap.css' %}" />
</head>

<body>

  <div class="container center">
    <div id="gallery-text">

      <div id="gallery-text-left">
        <p id="gallery-text-quote-left" style="font-family:Century Gothic; color:#006600"><b> Header</b></p>

        <p id="gallery-paragraph-1" style="font-family:Georgia">

          {% for key, value in content %}
          <span {% if key in diff_set %} style="color: red;" {% endif %}>{{ key }}: {{value}}</span><br> {% endfor %}
        </p>
      </div>


      <div id="gallery-text-right" style="float:left">
        <p id="gallery-text-quote-right" style="font-family:Century Gothic; color:#006600"><b>Header</b></p>
        <p id="gallery-paragraph-2" style="font-family:Georgia">
          {% for key, value in content_excel %}
          <span {% if key in diff_set %} style="color: red;" {% endif %}>{{ key }}: {{value}}</span><br> {% endfor %}
        </p>
      </div>
    </div>
  </div>
</body>

</html>
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading