Original link: https://www.williamlong.info/archives/6929.html
All articles of the blog are processed in one step, and the two full-width spaces at the beginning of the original article paragraphs are deleted, and the two full-width spaces at the beginning of the previous and subsequent article paragraphs will no longer be empty. The main reason for this is to make the website experience better in the mobile environment and to facilitate the layout and adjustment of future articles. At present, the use of mobile phones is increasing. When reading articles on mobile phones, the screen itself is not large. A few blank spaces make the page unsightly. If there are no spaces, the display effect is better on a small screen.
The processing method is to open the database and replace “<p>” with “<p>” through an update SQL statement for the article, so that the full-width spaces at the beginning of all article paragraphs are deleted, and then the article is rebuilt. That’s it. The specific SQL statement is as follows.
update blog_article set log_content = replace(log_content ,'<p> ‘,'<p>’)
In fact, in most websites or APPs on the Internet now, the rule of “two blank spaces” is not followed before paragraphs of articles, but is reflected in the form of blank lines between paragraphs, and the overall appearance is more beautiful and clear.
The first line of each paragraph of the article should be two blanks, mainly for the clarity of the paragraph. This is mainly for physical books and word processing software such as Word. In fact, it is unnecessary for web pages and e-readers.
In web pages, each paragraph is generally marked with <p></p>, and the spacing between paragraphs can be easily increased through CSS, which makes each paragraph very clear and clear, and there is no need to add two more spaces. The specific CSS code is as follows:
p{margin: 0 0 1em;}
Even if spaces are required in the future, two characters at the beginning of each line can be easily achieved through CSS statements. The specific CSS code is as follows:
p{text-indent: 2em;}
This article is reprinted from: https://www.williamlong.info/archives/6929.html
This site is for inclusion only, and the copyright belongs to the original author.