Click here to Skip to main content
15,882,114 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have elements in the following configuration:
HTML
<article>
<h2><a></a></h2>
<p></p>
</article>

The P element is taking up too much space and the article tag is not resizing

https://imgur.com/o9t9SCZ

What I have tried:

Using styling to fix it, looked it up...
Probably an easy fix that i'm just missing...
Posted
Updated 20-Mar-22 17:57pm

1 solution

You haven't explained what content you're adding within the tags, but from the image it looks like an unbroken string

Try adding style="overflow-wrap: break-word;" (or overflow-wrap: anywhere;)

So

HTML
<article>
<h2><a></a></h2>
<p style="overflow-wrap: anywhere;">eeee...eeeeee</p>
</article>
 
Share this answer
 
Comments
A-Games 21-Mar-22 15:51pm    
this did not work and also-- i had word-wrap: break-word in my css for P elements.
really in the A element it is just "Section Title" and the P element is just Section Content eeeeeee...eeeeeeeeeeeee
Chris Maunder 22-Mar-22 1:58am    
Happy to help out if you post the actual HTML you're trying to display. Otherwise we're just guessing

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900