简体   繁体   中英

HTML/CSS Column Spacing

I have the following two excerpts of code from a website I am messing around with. I am trying to make a change with the lines and I am struggling to do so. The idea is to have the following:

"Javascript"

4+ years

"HTML"

3+ years

and so on but without the line spacing added between the years and the programming language, in other words, only line spacing between each programming language. I have thought of using pre tag but that only makes it worse.

Edit: Please try to provide a solution that will not require 20 column divs/wrappers, or will mess with the positioning of the columns. Thank you!

HTML:

<div class="column" id="column1">
      <h2>Programming Languages</h2>
      Java 4+ yrs <br>
      SQL - 2+ yrs <br>
      JavaScript - 2 yrs <br>
      <h2>Tools</h2>
    </div>
    <div class="column" id="column2">
      Python - 2 yrs <br>
      C# - 1+ yrs <br>
      C++ - 1 yr <br>
    </div>

    <div class="column" id="column3">
      HTML ~ 1 yr <br>
      CSS ~ 1 yr <br>
      Bash ~ 1 yr
    </div>

CSS:

.column{
  position: absolute;
  color: white;
  font-size: 16px;
  line-height: 60px;
}

#column1{
  margin-top: 100px;
  left: 300px;
}

#column2{
  margin-top: 100px;
  left: 600px;
}

#column3{
  margin-top: 100px;
  left: 900px;
}

If i'm understanding your question correctly just add in your css style "line-height:How ever long"

You can put each language and years in

and wrap each language and year in div. Then add css line height property with the value you want to divs.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM