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

294
Views
Text content overflow its element tag

Here's the code. It's in Angular if that has something to do with it. The actual text height is overflowing the element that contains it.

#website-title {
    text-align: center;
    // font-family: "Roboto-Mono";
    font-size: 50px;
    margin: 0;
    position: absolute;
    top: 50%;
}
<p id="website-title">Poll App</p>

result:

enter image description here

I want the element to be the height of the content.

UPDATE: Narrowed the problem down to Angular Material. Everything is fine before doing ng add @angular/material. Then after adding material and restarting the server, I get the problem.

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

0

Be default, the p tag will expand to fit its content. So unless you have explicitly set the p tag height to be smaller than the text content, the text will not overflow.

Try checking to see if you have set a height on the p tag.

about 4 years ago · Juan Pablo Isaza Report

0

I found the solution but I don't know why it fixes the problem.

The problem had to do with Angular Material's typography (Angular material was installed). Sol'n - Go to index.html and remove the class="mat-typography" from the body tag.

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!