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 underline two div's consecutively?

I’ve got 2 <div>s that each gather their text from some JS that I’ve written.
But I want the end-result to look like in the following image. And I can’t figure out how to do that.

I can consolidate them into a single but then I have the issue of needing to apply two different weights to a single <div>, which also wracks my brain.

So basically I want text with 2 different font-weights to be underlined with no interruption.

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

I’ve tried the following, and a lot of googling:

div.parentDiv {
    text-decoration-line : underline;
}

Desired result

>Solution :

Is this what you are after?

div {
  font-weight: 700;
  text-decoration: underline;
}

div span {
  font-weight: 400;
}
<div>
  Good Reviews
  <span>(30)</span>
</div>

Its hard to know with your current question, could you add your HTML and JS so we can see the whole example.

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