Style adding method and device, equipment and medium

By quickly searching and adding style information through the correspondence between pre-save style collection identification and CSS style, the problem of low-efficiency in style addition in the existing technology is solved, efficient style addition and modification are achieved, and web development efficiency is improved.

CN118939257APending Publication Date: 2024-11-12CHINA CONSTRUCTION BANK +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410845276.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-27
Publication Date
2024-11-12

AI Technical Summary

Technical Problem

In the prior art, when adding CSS styles during web page development, it is necessary to manually find and add style codes, which are inefficient and cannot guarantee the search for all styles. Especially when the style collection identifier contains multiple CSS styles, the style addition efficiency is relatively high. Low.

Method used

Through the correspondence between the pre-save style collection identification and the CSS style, quickly find and display the CSS style information corresponding to the style collection identification, including the storage path and code location of the style file, and add and modify it according to the displayed style information to improve the style Add efficiency.

Benefits of technology

By quickly finding and adding style information, the efficiency of style addition is significantly improved, labor and time cost is saved, and style integrity is ensured.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118939257A_ABST
    Figure CN118939257A_ABST
Patent Text Reader

Abstract

The invention relates to the field of data processing, in particular to a style adding method and device, equipment and a medium, and is used for improving the adding efficiency of CSS styles. The method comprises the steps of determining a style set identifier in response to a first selection operation on a CSS style in a target page; style information of at least two CSS styles corresponding to the determined style set identifier is searched from a pre-stored first corresponding relation between the style set identifier and the CSS styles, and the style information of each CSS style comprises a storage path of the style file and a code position of the style code in the style file; displaying at least two types of CSS style information; and in response to the style adding operation, adding the storage path of the style file of each CSS style and the code position of the style code in the style file into the target page according to the style information of the at least two CSS styles. And the style adding efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing, and specifically to a style adding method, device, equipment and medium. Background Art

[0002] Cascading Style Sheets (CSS) is a tool used by developers to design font styles, colors, backgrounds, layout structures, animation effects, etc. of web pages during web development. The same CSS style may be written in the current style file or in other style files.

[0003] In the prior art, if you want to add CSS styles to a developed page, you need to manually search for each style corresponding to the style set identifier in each CSS style file and check the style code, and then add the style codes corresponding to each found CSS style to the developed page one by one. Especially when the CSS style set identifier to be added contains multiple CSS styles, the search efficiency is low, and it cannot be guaranteed that all CSS styles can be found, resulting in the problem of low style adding efficiency. Summary of the invention

[0004] The embodiments of the present application provide a style adding method, apparatus, device and medium for improving the efficiency of adding CSS styles.

[0005] In a first aspect, the present application provides a method for adding a style, the method comprising:

[0006] In response to a first selection operation on a CSS style in a target page, determining a style set identifier;

[0007] Searching for style information of at least two CSS styles corresponding to the determined style set identifier from a pre-saved first correspondence between the style set identifier and the CSS style, wherein the style information of each CSS style includes a storage path of the style file and a code position of the style code in the style file;

[0008] Displaying the at least two CSS style information;

[0009] In response to the style adding operation, according to the displayed style information of the at least two CSS styles, the storage path of the style file of each CSS style and the code position of the style code in the style file are added to the target page.

[0010] In a possible embodiment, the method further includes:

[0011] Based on the style information of the at least two CSS styles corresponding to the found set identifier, performing a comparative analysis on the style features of the at least two CSS styles to obtain a comparative analysis result of the at least two CSS styles;

[0012] Displaying the comparative analysis results;

[0013] In response to a modification operation on any CSS style in the comparison and analysis result, the CSS style is modified based on the at least two types of CSS style information displayed.

[0014] In a possible embodiment, before responding to the style adding operation, modifying the CSS style based on the at least two types of CSS style information displayed includes:

[0015] In response to a second selection operation on any target CSS style information among the at least two types of CSS style information displayed, based on a storage path of the style file in the target CSS style information, opening a style file corresponding to the storage path;

[0016] Locating the code position based on the code position of the style code in the CSS style information in the style file;

[0017] In response to a modification operation on the style code corresponding to the code position, modify the CSS style code;

[0018] Save the modified CSS style code.

[0019] In a possible embodiment, after determining the style set identifier, the method further includes:

[0020] In response to a third selection operation on the CSS style in the target page, based on the style set identifier, searching for style information of the CSS style corresponding to the determined set identifier from a second correspondence between the style set identifier and the CSS style that is pre-saved; the style information of the CSS style includes a storage path of a page file to which the CSS style is added, and a code position of the style code in the page file;

[0021] Display the found CSS style information.

[0022] In a possible embodiment, the method further includes:

[0023] In response to a rendering operation on the target page, determining a type of the style set identifier;

[0024] According to the type, determining a rendering rule corresponding to the type;

[0025] The target page is rendered based on the rendering rule and the style information of the at least two CSS styles added to the target page.

[0026] In a possible embodiment, rendering the target page based on the rendering rule and the style information of the at least two CSS styles added to the target page includes:

[0027] If it is determined that the at least two CSS styles added to the target page are CSS styles of different categories, rendering the target page based on all CSS styles;

[0028] If it is determined that there is a CSS style of the same category among the at least two CSS styles added to the target page, based on the preset priority of the CSS style, a target CSS style is selected from the CSS styles of the same category to render the target page, wherein the priority of the target CSS style is higher than the priority of other CSS styles among the CSS styles of the same category except the target CSS style.

[0029] In a second aspect, the present application provides a pattern adding device, the device comprising:

[0030] A determination module, configured to determine a style set identifier in response to a first selection operation on a CSS style in a target page;

[0031] A search module, used to search for style information of at least two CSS styles corresponding to the determined style set identifier from a pre-saved first correspondence between the style set identifier and the CSS style, wherein the style information of each CSS style includes a storage path of the style file and a code position of the style code in the style file;

[0032] A display module, used for displaying the at least two types of CSS style information;

[0033] The adding module is used to respond to the style adding operation and add the storage path of the style file of each CSS style and the code position of the style code in the style file to the target page according to the style information of the at least two CSS styles displayed.

[0034] In a possible embodiment, the device further includes:

[0035] An analysis module, configured to perform a comparative analysis on style features of the at least two CSS styles based on style information of the at least two CSS styles corresponding to the found set identifier, and obtain a comparative analysis result of the at least two CSS styles;

[0036] The display module is also used to display the comparison and analysis results;

[0037] The modification module is used to modify the CSS style based on the at least two types of CSS style information displayed in response to a modification operation on any CSS style in the comparison and analysis result.

[0038] In a possible embodiment, before the adding module responds to the style adding operation, the modifying module is specifically configured to:

[0039] In response to a second selection operation on any target CSS style information among the at least two types of CSS style information displayed, based on a storage path of the style file in the target CSS style information, opening a style file corresponding to the storage path;

[0040] Locating the code position based on the code position of the style code in the CSS style information in the style file;

[0041] In response to a modification operation on the style code corresponding to the code position, modify the CSS style code;

[0042] Save the modified CSS style code.

[0043] In a possible embodiment, after the determining module determines the style set identifier, the searching module is further configured to:

[0044] In response to a third selection operation on the CSS style in the target page, based on the style set identifier, searching for style information of the CSS style corresponding to the determined set identifier from a second correspondence between the style set identifier and the CSS style that is pre-saved; the style information of the CSS style includes a storage path of a page file to which the CSS style is added, and a code position of the style code in the page file;

[0045] The display module is also used to display the found CSS style information.

[0046] In a possible embodiment, the device further includes:

[0047] A rendering module, configured to determine the type of the style set identifier in response to a rendering operation on the target page;

[0048] According to the type, determining a rendering rule corresponding to the type;

[0049] The target page is rendered based on the rendering rule and the style information of the at least two CSS styles added to the target page.

[0050] In a possible embodiment, the rendering module is specifically used to:

[0051] If it is determined that the at least two CSS styles added to the target page are CSS styles of different categories, rendering the target page based on all CSS styles;

[0052] If it is determined that there are CSS styles of the same category among the at least two CSS styles added to the target page, based on the preset priority of the CSS styles, a target CSS style is selected from the CSS styles of the same category to render the target page, wherein the priority of the target CSS style is higher than the priority of other CSS styles among the CSS styles of the same category except the target CSS style.

[0053] In a third aspect, the present application provides an electronic device, including:

[0054] A memory for storing program instructions;

[0055] The processor is used to call the program instructions stored in the memory, and execute the steps included in any one of the methods in the first aspect according to the obtained program instructions.

[0056] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a computer, the computer executes any one of the methods described in the first aspect.

[0057] In a fifth aspect, the present application provides a computer program product, comprising: a computer program code, when the computer program code is run on a computer, the computer executes any one of the methods described in the first aspect.

[0058] The beneficial effects of this application are as follows:

[0059] In an embodiment of the present application, in response to a first selection operation on a CSS style in a target page, a style set identifier is determined; from a first correspondence between a pre-saved style set identifier and a CSS style, style information of at least two CSS styles corresponding to the determined style set identifier is searched, and the style information of each CSS style includes a storage path of a style file and a code position of the style code in the style file; at least two CSS style information is displayed; in response to a style adding operation, the storage path of the style file of each CSS style and the code position of the style code in the style file are added to the target page according to the style information of at least two CSS styles. In this way, through the first correspondence between a pre-saved style set identifier and a CSS style, the style information of at least two CSS styles corresponding to the style set identifier can be quickly found through the style set identifier, and then the style information of at least two CSS styles found can be added to the target page, thereby improving the efficiency of style adding and saving a lot of labor and time costs.

[0060] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] Figure 1 A flowchart of a method for adding a style provided in an embodiment of the present application;

[0062] Figure 2 A schematic diagram of a display interface provided in an embodiment of the present application;

[0063] Figure 3 A schematic diagram of another display interface provided in an embodiment of the present application;

[0064] Figure 4 A schematic diagram of the structure of a pattern adding device provided in an embodiment of the present application;

[0065] Figure 5 A structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0066] In order to make the purpose, technical scheme and advantages of the present application clearer, the technical scheme in the embodiment of the present application will be clearly and completely described below in conjunction with the drawings in the embodiment of the present application. Obviously, the described embodiment is only a part of the embodiment of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application. In the absence of conflict, the embodiments in the present application and the features in the embodiments can be arbitrarily combined with each other. In addition, although the logical order is shown in the flow chart, in some cases, the steps shown or described can be performed in an order different from that here.

[0067] The terms "first" and "second" in the specification and claims of the present application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the term "comprising" and any of their variations are intended to cover non-exclusive protection. For example, a process, method, system, product or device comprising a series of steps or units is not limited to the listed steps or units, but optionally also includes steps or units that are not listed, or optionally also includes other steps or units inherent to these processes, methods, products or devices. "Multiple" in the present application can mean at least two, for example, two, three or more, and the embodiments of the present application are not limited.

[0068] The following is a description of exemplary embodiments of the present application in conjunction with the accompanying drawings, including various details of the embodiments of the present application to facilitate understanding, which should be considered as merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope of the present application. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description. It should be noted that in the embodiments of the present application, certain software, components, models and other existing solutions in the industry may be mentioned, which should be considered as exemplary, and their purpose is only to illustrate the feasibility of the implementation of the technical solution of the present application, but it does not mean that the applicant has or will necessarily use the solution.

[0069] In the technical solution of this application, the acquisition, transmission, storage, and use of data are in compliance with the requirements of relevant national laws and regulations.

[0070] Before introducing the style adding method provided in the embodiment of the present application, in order to facilitate understanding, the technical background of the embodiment of the present application is first introduced in detail below.

[0071] CSS is a tool used by developers to design font styles, colors, backgrounds, layout structures, animation effects, and other styles of web pages during web page development. The same CSS style may be written in the current style file or in other style files.

[0072] In the prior art, if you want to add CSS styles to a developed page, you need to manually search for each style corresponding to the style set identifier in each CSS style file and check the style code, and then add the style codes corresponding to each found CSS style to the developed page one by one. Especially when the CSS style set identifier to be added contains multiple CSS styles, the search efficiency is low, and it cannot be guaranteed that all CSS styles can be found, resulting in the problem of low style adding efficiency.

[0073] Therefore, the existing style adding method has the problem of low adding efficiency.

[0074] In view of this, in order to solve the problem of low adding efficiency in the existing stage adding method, the embodiment of the present application provides a style adding method, device, equipment and medium. The following describes some preferred embodiments of the present application in conjunction with the drawings of the specification.

[0075] See also Figure 1 , Figure 1 A flowchart of a style adding method provided in an embodiment of the present application. The method can be implemented by an electronic device, which may be a terminal or a server. The present application does not limit this. The method includes the following steps.

[0076] In step 101, in response to a first selection operation on a CSS style in a target page, a style set identifier is determined.

[0077] In specific implementation, a CSS style file may contain multiple CSS style sets. For example, style file 1 contains style set 1 and style set 2. Each style set can be used to define different style categories of a web page. The style categories include font, color, font size, page margins, etc. The same CSS style set may also exist in the same CSS style file and different CSS style files. For example, both style file 1 and style file 2 contain style set 1.

[0078] In specific implementation, the target page is a page used by developers to develop web pages. A CSS style set can be added to the target page based on the developer's web page style design requirements, in response to the first selection operation of the CSS style in the target page, wherein the triggering condition of the first selection operation can be set according to actual conditions, and the embodiment of the present application is not specifically limited. For example, the first selection operation of the CSS style can be triggered when certain preset operations of the user on the CSS style are detected (such as a single-click operation, a double-click operation, a preset dwell time, or a sliding operation, wherein the single-click operation and the double-click operation can also be divided into a right-click or a double-click, or a left-click or a double-click); or the first selection operation of the CSS style can be triggered according to the CSS style acquisition command input by the user. After the first selection operation of the CSS style is detected, the system can determine the style set identifier by triggering the CSS style corresponding to the first selection operation, wherein the style set identifier can be the name of the CSS style set.

[0079] In step 102, style information of at least two CSS styles corresponding to the determined style set identifier is searched from the pre-saved first correspondence between the style set identifier and the CSS style, and the style information of each CSS style includes the storage path of the style file and the code position of the style code in the style file.

[0080] During specific implementation, the first correspondence between the pre-saved style set identifier and the CSS style may be established through the following steps, for example.

[0081] Step 1: Monitor the saved style files.

[0082] Among them, the style file can be a file with a suffix of css, less, scss, etc.

[0083] Step 2: Obtain the storage path of each style file, and read each CSS style set in the style file and the code position of the style code corresponding to each CSS style set in the style file.

[0084] The code position may be the line number where the code is in the style file. Specifically, the line number where the CSS style set identifier is located in the style code may be used as the code position of the style code corresponding to the CSS style set in the style file.

[0085] Step 3: Then take the style set identifier of each CSS style set counted, the storage path of the style file corresponding to the CSS style set, and the code position of the style code corresponding to the CSS style set in the style file as a statistical record to establish the first correspondence between the style set identifier and the CSS style.

[0086] Assume that the content of style file 1 is as shown in Table 1, and the content of style file 2 is as shown in Table 2.

[0087] Table 1

[0088] Style file 1 Storage path 1 CSS Style Set 1 Style code 1 and code position 1 Style 1, Style 2 CSS Style Set 2 Style code 2 and code location 2 Style 3, Style 4

[0089] Table 2

[0090] Style file 2 Storage path 2 CSS Style Set 1 Style code 3 and code location 3 Style 1, Style 5 CSS Style Set 3 Style code 4 and code location 4 Style 6, Style 7

[0091] As can be seen from Table 1, style file 1 contains CSS style set 1 and CSS style set 2, and CSS style set 1 corresponds to style code 1, the code position of style code 1 is code position 1, CSS style set 1 contains style 1 and style 2, CSS style set 2 corresponds to style code 2, the code position of style code 2 is code position 2, and CSS style set 2 contains style 3 and style 4.

[0092] As can be seen from Table 2, style file 2 contains CSS style set 1 and CSS style set 3, and CSS style set 1 corresponds to style code 3, the code position of style code 3 is code position 3, CSS style set 1 contains style 1 and style 5, CSS style set 3 corresponds to style code 3, the code position of style code 3 is code position 3, and CSS style set 3 contains style 6 and style 7.

[0093] Based on this, a first correspondence between the style set identifier and the CSS style as shown in Table 3 can be established for the sample files shown in Table 1 and Table 2 above.

[0094] Table 3

[0095]

[0096] Taking the first correspondence between the style set identifier and the CSS style shown in Table 3 as an example, assuming that the determined style set identifier is CSS style set 1, then by searching from the first correspondence based on CSS style set 1, the style information of the corresponding CSS style can be determined, which are CSS style 1 (CSS style set 1, storage path 1, code location 1) and CSS style 2 (CSS style set 1, storage path 2, code location 3).

[0097] In this way, through the pre-saved first correspondence between the style set identifier and the CSS style, the style information of at least two CSS styles corresponding to the style set identifier can be quickly found through the style set identifier, thereby improving the style query efficiency, thereby improving the style adding efficiency and saving a lot of labor and time costs.

[0098] In step 103, at least two types of CSS style information are displayed.

[0099] In a specific implementation, after at least two types of CSS style information are found, they can be displayed in a preset display manner, wherein the preset display manner is, for example, in the form of a list menu.

[0100] Assuming that the first correspondence between the pre-saved style set identifier and the CSS style is as shown in Table 3, the determined style set identifier is CSS style set 1, and the two CSS style information queried are CSS style 1 (CSS style set 1, storage path 1, code location 1) and CSS style 2 (CSS style set 1, storage path 2, code location 3) as an example, see Figure 2 , Figure 2 A display interface schematic diagram provided for an embodiment of the present application, wherein the display order of each CSS style information item in the list can be displayed according to the order of the first correspondence between the style set identifier and the CSS style shown in Table 3, and the specific display method is not limited in this application.

[0101] In a specific implementation, after displaying the style information of at least two CSS styles corresponding to the found set identifier, in fact, the efficiency of adding styles can be further improved.

[0102] In a specific implementation, based on the style information of at least two CSS styles corresponding to the found set identifier, a comparative analysis can be performed on the style characteristics of the at least two CSS styles to obtain a comparative analysis result of the at least two CSS styles; the comparative analysis result is then displayed, and thereafter, in response to a modification operation on any CSS style in the comparative analysis result, the CSS style can be modified based on the at least two CSS style information displayed.

[0103] Among them, there may be two situations for the style codes in the style information of at least two CSS styles corresponding to the found set identifier. Situation one contains styles of different categories. For example, the style code in the style information of one CSS style contains a font style code and a font size style code, and the style code in the style information of another CSS style contains a background style code and a color style code. Situation two contains styles of the same category. For example, the style codes in the style information of two CSS styles both contain a font style code and a font size style code, and only the specific setting values ​​are different.

[0104] In specific implementation, for the above two situations, the style features of the two CSS styles can be compared and analyzed. For example, for situation one, the style categories contained in the style code in the style information of each CSS style can be listed separately. In this way, the developers can further understand the specific content of the style information of the CSS style. For situation two, for the same style category contained in the style code in the style information of each CSS style, the specific style values ​​in the style information of different CSS styles can be compared. In this way, the developers can more intuitively understand the specific difference between the style information of the two CSS styles. Of course, the display of the comparative analysis results can be displayed in the form of a list or in the form of a comparison chart, and this application is not limited to this.

[0105] According to the displayed comparison results, the developer does not need to enter the corresponding style file to view the style code to determine whether to modify the style code corresponding to this style file. Therefore, the efficiency of style adding can be further improved.

[0106] Afterwards, through a second selection operation on any target CSS style information among the at least two types of CSS style information displayed, based on the storage path of the style file in the target CSS style information, the style file corresponding to the storage path can be opened; based on the code position of the style code in the CSS style information in the style file, the code position can be located, and then, in response to a modification operation on the style code corresponding to the code position, the CSS style code can be modified and the modified CSS style code can be saved.

[0107] Among them, the triggering condition of the second selection operation can be set according to actual conditions, and the embodiment of the present application does not make specific limitations. For example, when it is detected that the user acts on certain preset operations of any target CSS style information in the displayed CSS style information (such as a single-click operation, a double-click operation, a preset stay time or a sliding operation, wherein the single-click operation and the double-click operation can also be divided into a right-click or double-click, or a left-click or double-click), the second selection operation of the target CSS style information is triggered; or the second selection operation of the target CSS style information can be triggered according to the acquisition command of the target CSS style information input by the user.

[0108] In this way, through the displayed CSS style information, the specific style code can be directly located through the storage path of the style file in the CSS style information and the code position of the style code in the style file, which speeds up the query time of the style code and improves the efficiency of style adding.

[0109] In a specific implementation, in addition to displaying at least two types of CSS style information found, in response to a third selection operation on the CSS style in the target page, based on a style set identifier, the style information of the CSS style corresponding to the determined set identifier is searched from a second correspondence between a pre-saved style set identifier and the CSS style; wherein the style information of the CSS style includes the storage path of the page file to which the CSS style is added, and the code position of the style code in the page file, and then the found CSS style information is displayed.

[0110] Among them, the triggering condition of the third selection operation can be set according to actual conditions, and the embodiments of the present application do not make specific limitations. For example, when certain preset operations of the user on the CSS style in the target page are detected (such as a single-click operation, a double-click operation, a preset stay time or a sliding operation, wherein the single-click operation and the double-click operation can also be divided into a right-click or double-click, or a left-click or double-click), the third selection operation on the CSS style in the target page is triggered; or the third selection operation on the CSS style in the target page can be triggered according to the selection command for the CSS style in the target page input by the user.

[0111] During specific implementation, the second correspondence between the pre-saved style set identifier and the CSS style may be established through the following steps, for example.

[0112] Step 1: Monitor the saved page files.

[0113] Among them, the page file can be a file with a suffix of vue, js, jsx, etc.

[0114] Step 2: Obtain the storage path of each page file, and read each CSS style set in the page file and the code position of the style code corresponding to each CSS style set in the page file.

[0115] The code position may be the line number where the code is in the page file. Specifically, the line number where the CSS style set identifier in the style code is located may be used as the code position of the style code corresponding to the CSS style set in the page file.

[0116] Step three: Then take the style set identifier of each CSS style set counted, the storage path of the page file corresponding to the CSS style set, and the code position of the style code corresponding to the CSS style set in the page file as a statistical record to establish a second corresponding relationship between the style set identifier and the CSS style.

[0117] Assume that the content of page file 1 is as shown in Table 4, and the content of page file 2 is as shown in Table 5.

[0118] Table 4

[0119] Page file 1 Storage path a CSS Style Set 1 Style code 1 and code position 5 Style 1, Style 2 CSS Style Set 2 Style code 2 and code position 6 Style 3, Style 4

[0120] Table 5

[0121] Page File 2 Storage path b CSS Style Set 1 Style code 3 and code position 7 Style 1, Style 5 CSS Style Set 3 Style code 4 and code position 8 Style 6, Style 7

[0122] Based on this, a second correspondence between the style set identifier and the CSS style as shown in Table 6 can be established for the page files shown in Table 4 and Table 5 above.

[0123] Table 6

[0124]

[0125] Assuming that the determined style set is identified as CSS style set 1, the style information of the corresponding CSS style can be determined by searching from the second corresponding relationship based on CSS style set 1, which are CSS style 1 (CSS style set 1, storage path a, code position 5), which means that CSS style set 1 is added to the page file corresponding to storage path a, and the code position of CSS style set 1 in the page file is code position 5; CSS style 2 (CSS style set 1, storage path b, code position 7), which means that CSS style set 1 is also added to the page file corresponding to storage path b, and the code position of CSS style set 1 in the page file is code position 7.

[0126] In specific implementation, after the CSS style information is found, it can be displayed in a preset display mode, wherein the preset display mode is, for example, in the form of a list menu.

[0127] Assuming that the second correspondence between the pre-saved style set identifier and the CSS style is as shown in Table 6, the determined style set identifier is CSS style set 1, and the two CSS style information queried are CSS style 1 (CSS style set 1, storage path a, code position 5) and CSS style 2 (CSS style set 1, storage path b, code position 7) as an example, see Figure 3 , Figure 3 Another display interface schematic diagram provided for an embodiment of the present application, wherein the first part of the list displays query results based on a first correspondence, and the second part of the list displays query results based on a second correspondence. The display order of each CSS style information item in the list can be displayed in the order of the correspondence between the style set identifier and the CSS style shown in Table 3 and Table 6. The specific display method is not limited in this application.

[0128] In this way, the storage path of the page file to which the CSS style is added and the code location of the style code in the page file are displayed. Based on the displayed storage path and code location, it is easy to find specific code information in the page file, which is beneficial for providing code references for developers during the development process of the target page.

[0129] In step 104, in response to the style adding operation, according to the displayed style information of at least two CSS styles, the storage path of the style file of each CSS style and the code position of the style code in the style file are added to the target page.

[0130] In specific implementation, the style adding operation can be triggered based on a received save operation on the target page, or can be triggered based on a style adding operation command for issuing. This application does not limit this. After the style adding operation is triggered, the storage path of the style file of each CSS style and the code position of the style code in the style file can be added to the target page based on the style information of at least two CSS styles displayed, so as to find the corresponding style code based on the added style information and render the target page according to the style code.

[0131] In specific implementation, the type of the style set identifier can be determined in response to the rendering operation on the target page, and then the rendering rule corresponding to the type can be determined according to the type. The type of the style set identifier is set according to the style category included in the style set.

[0132] Among them, the rendering rules are, for example, if it is determined that at least two CSS styles added to the target page are CSS styles of different categories, the target page is rendered based on all CSS styles; if it is determined that at least two CSS styles added to the target page include CSS styles of the same category, based on the preset priority of the CSS styles, the target page is rendered by selecting the target CSS style from the CSS styles of the same category, wherein the priority of the target CSS style is higher than the priority of other CSS styles except the target CSS style among the CSS styles of the same category.

[0133] Assume that there are CSS styles of the same category in the two CSS styles, such as CSS style 1 includes font size style 1, and CSS style 2 includes font size style 2. Then, the target CSS style can be determined according to the priorities of CSS style 1 and CSS style 2. For example, if the priority of CSS style 1 is higher than the priority of CSS style 2, the target CSS style is CSS style 1.

[0134] Finally, based on the rendering rules and style information of at least two CSS styles added to the target page, the target page is rendered.

[0135] In this way, rendering according to the rendering rules can avoid rendering conflicts caused by style conflicts caused by styles of the same category.

[0136] Based on the same inventive concept, the present application embodiment provides a structural schematic diagram of a style adding device, please refer to Figure 4 , the device comprises:

[0137] A determination module 401, configured to determine a style set identifier in response to a first selection operation on a CSS style in a target page;

[0138] A search module 402 is used to search for style information of at least two CSS styles corresponding to the determined style set identifier from a pre-saved first correspondence between the style set identifier and the CSS style, wherein the style information of each CSS style includes a storage path of the style file and a code position of the style code in the style file;

[0139] Display module 403, used to display the at least two types of CSS style information;

[0140] The adding module 404 is used to add the storage path of the style file of each CSS style and the code position of the style code in the style file to the target page in response to the style adding operation according to the style information of the at least two CSS styles displayed.

[0141] In a possible embodiment, the device further includes:

[0142] The analysis module 405 is used to compare and analyze the style characteristics of the at least two CSS styles based on the style information of the at least two CSS styles corresponding to the found set identifier, and obtain the comparison and analysis results of the at least two CSS styles;

[0143] The display module 403 is also used to display the comparison and analysis results;

[0144] The modification module 406 is configured to modify the CSS style in response to a modification operation on any CSS style in the comparison and analysis result based on the at least two types of CSS style information displayed.

[0145] In a possible embodiment, before the adding module responds to the style adding operation, the modifying module 406 is specifically configured to:

[0146] In response to a second selection operation on any target CSS style information among the at least two types of CSS style information displayed, based on a storage path of the style file in the target CSS style information, opening a style file corresponding to the storage path;

[0147] Locating the code position based on the code position of the style code in the CSS style information in the style file;

[0148] In response to a modification operation on the style code corresponding to the code position, modify the CSS style code;

[0149] Save the modified CSS style code.

[0150] In a possible embodiment, after the determining module determines the style set identifier, the searching module 402 is further configured to:

[0151] In response to a third selection operation on the CSS style in the target page, based on the style set identifier, searching for style information of the CSS style corresponding to the determined set identifier from a second correspondence between the style set identifier and the CSS style that is pre-saved; the style information of the CSS style includes a storage path of a page file to which the CSS style is added, and a code position of the style code in the page file;

[0152] The display module 403 is further configured to display the found CSS style information.

[0153] In a possible embodiment, the device further includes:

[0154] A rendering module 407, configured to determine the type of the style set identifier in response to a rendering operation on the target page;

[0155] According to the type, determining a rendering rule corresponding to the type;

[0156] The target page is rendered based on the rendering rule and the style information of the at least two CSS styles added to the target page.

[0157] In a possible embodiment, the rendering module 407 is specifically configured to:

[0158] If it is determined that the at least two CSS styles added to the target page are CSS styles of different categories, rendering the target page based on all CSS styles;

[0159] If it is determined that there is a CSS style of the same category among the at least two CSS styles added to the target page, based on the preset priority of the CSS style, a target CSS style is selected from the CSS styles of the same category to render the target page, wherein the priority of the target CSS style is higher than the priority of other CSS styles among the CSS styles of the same category except the target CSS style.

[0160] Based on the same inventive concept, the embodiment of the present application provides an electronic device, which can realize the functions of the style adding device discussed above, please refer to Figure 5 The device includes a memory 501, one or more processors 502, and a bus 503.

[0161] The memory 501 is used to store computer programs executed by the processor 501. The memory 501 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system and programs required for running the instant messaging function, etc.; the data storage area may store various instant messaging information and operation instruction sets, etc.

[0162] The memory 501 may be a volatile memory, such as a random-access memory (RAM); the memory 501 may also be a non-volatile memory, such as a read-only memory, a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD), or the memory 501 may be any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 501 may be a combination of the above memories.

[0163] The processor 502 may include one or more central processing units (CPU) or a digital processing unit, etc. The processor 502 is used to implement the style adding method in the above embodiment when calling the computer program stored in the memory 502 .

[0164] The specific connection medium between the memory 501 and the processor 502 is not limited in the embodiment of the present application. Figure 5 In the embodiment, the memory 501 and the processor 502 are connected via a bus 503. The bus 503 is connected to the processor 502 via a bus 503. Figure 5 The connections between other components are shown in bold lines, and are not intended to be limiting. Bus 503 can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 5 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0165] Based on the same inventive concept, the embodiment of the present application provides a computer-readable storage medium, and the computer program product includes: computer program code, when the computer program code is run on a computer, the computer executes any of the style adding methods discussed above. Since the principle of solving the problem by the above-mentioned computer-readable storage medium is similar to that of the style adding method, the implementation of the above-mentioned computer-readable storage medium can refer to the implementation of the method, and the repeated parts will not be repeated.

[0166] Based on the same inventive concept, the embodiment of the present application also provides a computer program product, which includes: computer program code, when the computer program code is run on a computer, the computer executes any of the style adding methods discussed above. Since the principle of solving the problem by the above computer program product is similar to that of the style adding method, the implementation of the above computer program product can refer to the implementation of the method, and the repeated parts will not be repeated.

[0167] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0168] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0169] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0170] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of user-operated steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0171] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A method for adding a style, characterized in that: The method comprises: In response to a first selection operation on a CSS style in a target page, determining a style set identifier; Searching for style information of at least two CSS styles corresponding to the determined style set identifier from a pre-saved first correspondence between the style set identifier and the CSS style, wherein the style information of each CSS style includes a storage path of the style file and a code position of the style code in the style file; Displaying the at least two CSS style information; In response to the style adding operation, according to the displayed style information of the at least two CSS styles, the storage path of the style file of each CSS style and the code position of the style code in the style file are added to the target page.

2. The method according to claim 1, characterized in that The method further comprises: Based on the style information of the at least two CSS styles corresponding to the found set identifier, performing a comparative analysis on the style features of the at least two CSS styles to obtain a comparative analysis result of the at least two CSS styles; Displaying the comparative analysis result; In response to a modification operation on any CSS style in the comparison and analysis result, the CSS style is modified based on the at least two types of CSS style information displayed.

3. The method according to claim 2, characterized in that Before responding to the style adding operation, modifying the CSS style based on the at least two types of CSS style information displayed includes: In response to a second selection operation on any target CSS style information among the at least two types of CSS style information displayed, based on a storage path of the style file in the target CSS style information, opening a style file corresponding to the storage path; Locating the code position based on the code position of the style code in the CSS style information in the style file; In response to a modification operation on the style code corresponding to the code position, modify the CSS style code; Save the modified CSS style code.

4. The method according to claim 1, characterized in that After determining the style set identifier, the method further includes: In response to a third selection operation on the CSS style in the target page, based on the style set identifier, searching for style information of the CSS style corresponding to the determined set identifier from a second correspondence between the style set identifier and the CSS style that is pre-saved; the style information of the CSS style includes a storage path of a page file to which the CSS style is added, and a code position of the style code in the page file; Display the found CSS style information.

5. The method according to claim 1, characterized in that The method further comprises: In response to a rendering operation on the target page, determining a type of the style set identifier; According to the type, determining a rendering rule corresponding to the type; The target page is rendered based on the rendering rule and the style information of the at least two CSS styles added to the target page.

6. The method according to claim 5, characterized in that The rendering of the target page based on the rendering rule and the style information of the at least two CSS styles added to the target page includes: If it is determined that the at least two CSS styles added to the target page are CSS styles of different categories, rendering the target page based on all CSS styles; If it is determined that there are CSS styles of the same category among the at least two CSS styles added to the target page, based on the preset priority of the CSS styles, a target CSS style is selected from the CSS styles of the same category to render the target page, wherein the priority of the target CSS style is higher than the priority of other CSS styles among the CSS styles of the same category except the target CSS style.

7. A pattern adding device, characterized in that: The device comprises: A determination module, configured to determine a style set identifier in response to a first selection operation on a CSS style in a target page; A search module, used to search for style information of at least two CSS styles corresponding to the determined style set identifier from a pre-saved first correspondence between the style set identifier and the CSS style, wherein the style information of each CSS style includes a storage path of the style file and a code position of the style code in the style file; A display module, used for displaying the at least two types of CSS style information; The adding module is used to respond to the style adding operation and add the storage path of the style file of each CSS style and the code position of the style code in the style file to the target page according to the style information of the at least two CSS styles displayed.

8. The device according to claim 7, characterized in that The device also includes: An analysis module, configured to perform a comparative analysis on style features of the at least two CSS styles based on style information of the at least two CSS styles corresponding to the found set identifier, and obtain a comparative analysis result of the at least two CSS styles; The display module is also used to display the comparison and analysis results; The modification module is used to modify the CSS style based on the at least two types of CSS style information displayed in response to a modification operation on any CSS style in the comparison and analysis result.

9. The device according to claim 7, characterized in that Before the adding module responds to the style adding operation, the modifying module is specifically used to: In response to a second selection operation on any target CSS style information among the at least two types of CSS style information displayed, based on a storage path of the style file in the target CSS style information, opening a style file corresponding to the storage path; Locating the code position based on the code position of the style code in the CSS style information in the style file; In response to a modification operation on the style code corresponding to the code position, modify the CSS style code; Save the modified CSS style code.

10. The device according to claim 7, characterized in that After the determining module determines the style set identifier, the searching module is further configured to: In response to a third selection operation on the CSS style in the target page, based on the style set identifier, searching for style information of the CSS style corresponding to the determined set identifier from a second correspondence between the style set identifier and the CSS style that is pre-saved; the style information of the CSS style includes a storage path of a page file to which the CSS style is added, and a code position of the style code in the page file; The display module is also used to display the found CSS style information.

11. The device according to claim 7, characterized in that The device also includes: A rendering module, configured to determine the type of the style set identifier in response to a rendering operation on the target page; According to the type, determining a rendering rule corresponding to the type; The target page is rendered based on the rendering rule and the style information of the at least two CSS styles added to the target page.

12. The device according to claim 11, characterized in that The rendering module is specifically used for: If it is determined that the at least two CSS styles added to the target page are CSS styles of different categories, rendering the target page based on all CSS styles; If it is determined that there are CSS styles of the same category among the at least two CSS styles added to the target page, based on the preset priority of the CSS styles, a target CSS style is selected from the CSS styles of the same category to render the target page, wherein the priority of the target CSS style is higher than the priority of other CSS styles among the CSS styles of the same category except the target CSS style.

13. An electronic device, characterized in that: include: A memory for storing program instructions; A processor is used to call the program instructions stored in the memory, and execute the steps included in any one of claims 1-6 according to the obtained program instructions.

14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a computer, the computer executes the method according to any one of claims 1 to 6.

15. A computer program product, characterized in that The computer program product comprises: a computer program code, and when the computer program code is run on a computer, the computer is enabled to execute the method according to any one of claims 1 to 6.