Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

266
Views
Draw line between 2 elements in reactJS

I'm working on a flights agency website, and at some point I need to draw some lines between elements that are being added dynamically.

See the image to understand what I'm trying to do: enter image description here

Let's suppose that for each departure and destination there are 2 divs, One for departure and one for destination!

Example: The below elements will be added to the DOM dynamically depending on the API response for flights.

<!--First flight-->

<div className="flight">
    <div className="element">Bucharest<div>
    <!--image element here-->
    <div className="element">Tenerife<div>
</div>


<!--Second flight-->

<div className="flight">
    <div className="element">Tenerife<div>
     <!--image element here-->
    <div className="element">Bucharest<div>
</div>

I found some Javascript solutions but I need to specify which elements are concerned which I cannot do in my case cause the elements are being added dynamically depending on the amount of flights.

I would be preferable to find a solution with only CSS but I think that might be impossible.

Thank you!

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You can use the <hr element in HTML. This draws a line between the two elements.

You can see more information about it on

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/hr

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!