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

186
Views
Fit width of absolute element to content

I am trying to customize the tooltip's width of element-ui framework because text inside tooltip is broken incorrectly.

Here is generated tooltip element with is placed on the bottom of body tag

<div role="tooltip" id="el-tooltip-8061" aria-hidden="true" class="el-tooltip__popper is-dark popper-width" style="transform-origin: center top;z-index: 2031;/* display: none; */">
   <div data-v-65209316="" class="row">
      <div data-v-65209316="" class="col-5">Employee</div>
      <div data-v-65209316="" class="col-7">John Smith</div>
   </div>
   <div x-arrow="" class="popper__arrow" style="left: 77px;"></div>
</div>

and here is my vue code:

<el-tooltip placement="bottom" theme="dark" popper-class="popper-width" :popper-options="customPopperOptions">
    <template slot="content">
        <div class="row">
            <div class="col-5">
                Employee
            </div>
            <div class="col-7">
                John Smith
            </div>
        </div>
    </template>
</el-tooltip>

and

customPopperOptions() {
  return {container: document.body, boundariesElement: document.body}
}

enter image description here

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

0

I see you are using bootstrap classes, have you thought about splitting them out because your 12 grid has less space to occupy on your employee tooltip. 1st off, try evening them out:

       <div class="row">
            <div class="col-6">
                Employee
            </div>
            <div class="col-6">
                John Smith
            </div>
        </div

See if that works, should split the difference. If this causes issues then you will probably need to adjust your CSS code because it looks as though your class .popper-width has a set width.

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!