Tìm kiếm hỗ trợ

Tránh các lừa đảo về hỗ trợ. Chúng tôi sẽ không bao giờ yêu cầu bạn gọi hoặc nhắn tin đến số điện thoại hoặc chia sẻ thông tin cá nhân. Vui lòng báo cáo hoạt động đáng ngờ bằng cách sử dụng tùy chọn "Báo cáo lạm dụng".

Learn More

Wordpress "justify" not working

  • 5 trả lời
  • 1 gặp vấn đề này
  • 34 lượt xem
  • Trả lời mới nhất được viết bởi jonzn4SUSE

more options

I run a blog on WordPress and while editing a blog post I tried to "justify" the paragraph but it did not work. I previously used chrome in which it worked, but in Firefox it seems that its is not working.

Đính kèm ảnh chụp màn hình

Được chỉnh sửa bởi Najm Us Saqib vào

Tất cả các câu trả lời (5)

more options

When I check both the Block editor and the Classic editor I have choices of Left, Center, and Right alignment. Are those the buttons that are not working for you? I'm attaching a screenshot of the buttons I'm referring to.

Hữu ích?

more options

I am talking about the block editor and attaching screenshot. The justify feature justifies the sentences in equal length. Other chromium based browser, this works.

Hữu ích?

more options

Your menu is different than mine. You must be using a plugin to add Justify to it. Maybe it's this one?

https://wordpress.org/plugins/block-options/

When I use that plugin to apply justify to a paragraph, I don't see any difference in the editor, but if I click Preview, then in the preview of the edited page, the paragraph is justified.

In the editor, the paragraphs are styled with

white-space: pre-wrap;

which appears to override or conflict with

text-align: justify;

Here's a basic demo for people who don't have a WordPress site: https://jsfiddle.net/f2bLq95s/

Potential Workaround

You could consider a style hack that would override the white-space rule. The plugin I tested adds "has-text-align-justify" to the list of classes for the paragraph, so a style rule could detect that and force white-space to normal for those paragraphs, allowing them to appear justified in the editor:

.has-text-align-justify {
    white-space: normal !important;
}

That gives the result in the screenshot.

That class name may vary depending on your plugin, and you also may need some guidance on how to apply this rule to your WordPress automatically.

Future Firefox Fix

I found a bug on file for this and updated it with a reference to this thread. Since most developers won't have a WordPress site, I provided some background information as well. There's no need to add any further comments at this time. Since this bug is five years old and does not yet have a priority assigned, you should not hold your breath for a fix in the immediate future.

Hữu ích?

more options

This is the major problem why people don't prefer using Firefox over chromium browsers. People here at Firefox don't fix problems as soon as they get it. I mean its five years old bug still it is not in their priority list (what a joke). There were lots of problems with Firefox when I started using it in Ubuntu. Even the YouTube live and twitter videos were not playing, I had to fix it myself by installing codecs, meanwhile this is not the case with chromium, I was able to play videos on chromium just out of box. Still thank you for your support.

Hữu ích?

more options

Have you tried a newer version of Firefox?

Operating System: openSUSE Tumbleweed 20201224 KDE Plasma Version: 5.20.4 KDE Frameworks Version: 5.77.0 Qt Version: 5.15.2 Kernel Version: 5.10.1-1-default OS Type: 64-bit Processors: 8 × Intel® Core™ i7-4810MQ CPU @ 2.80GHz Memory: 31.0 GiB of RAM Graphics Processor: Mesa DRI Intel® HD Graphics 4600

Hữu ích?

Đặt một câu hỏi

Bạn phải đăng nhập vào tài khoản của bạn để trả lời bài viết. Vui lòng bắt đầu một câu hỏi mới, nếu bạn chưa có tài khoản.