Opened 18 months ago

Closed 8 months ago

Last modified 8 months ago

#6732 closed defect (bug) (fixed)

table of contents is width of longest link

Reported by: joyously's profile joyously Owned by:
Milestone: Priority: normal
Component: Developer Hub Keywords: has-screenshots


Some of the headings can be long, and the table of contents is not set to a max width, so the long heading can make the table wider than the page content.

It looks like CSS for max-width is needed.
See for an example.

Attachments (1)

wp_enqueue_script() Function WordPress Developer Resources-01.jpg (81.1 KB) - added by joyously 18 months ago.
table of contents is wider than page content

Download all attachments as: .zip

Change History (4)

18 months ago

table of contents is wider than page content

#1 @dufresnesteven
17 months ago

I've tested this in the new theme (, which should be launched soon-ish, and this issue no longer exists there.

I'll leave this open for now but it shouldn't require any work.

#2 @coffee2code
8 months ago

  • Resolution set to fixed
  • Status changed from new to closed

Fixed in 884ca0a on GitHub:

Prevent long links in ToC from making ToC too wide.

Props joyously.
Fixes #6732.

#3 @coffee2code
8 months ago

#7075 was marked as a duplicate.

Note: See TracTickets for help on using tickets.