CN110489117A - A kind of page layout method and device - Google Patents

A kind of page layout method and device Download PDF

Info

Publication number
CN110489117A
CN110489117A CN201810462460.4A CN201810462460A CN110489117A CN 110489117 A CN110489117 A CN 110489117A CN 201810462460 A CN201810462460 A CN 201810462460A CN 110489117 A CN110489117 A CN 110489117A
Authority
CN
China
Prior art keywords
layout
flex
page
page layout
expression
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201810462460.4A
Other languages
Chinese (zh)
Inventor
鲍伟杰
崔顶峰
巩仔明
邱慧
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Che Bole (beijing) Mdt Infotech Ltd
Original Assignee
Che Bole (beijing) Mdt Infotech Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Che Bole (beijing) Mdt Infotech Ltd filed Critical Che Bole (beijing) Mdt Infotech Ltd
Priority to CN201810462460.4A priority Critical patent/CN110489117A/en
Publication of CN110489117A publication Critical patent/CN110489117A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Document Processing Apparatus (AREA)

Abstract

The present invention relates to a kind of page layout method and device, one of page layout method, which comprises determine the form of expression of page layout;According to the determining form of expression, flex attribute configuration layout pattern is utilized;Utilize the layout pattern layout page.By means of the present invention and device, webpage development efficiency is effectively improved.

Description

A kind of page layout method and device
Technical field
The present invention relates to field of computer technology more particularly to a kind of page layout methods and device.
Background technique
Initially when carrying out webpage design, use hypertext markup language (Hyper Text Markup Language, Referred to as: HTML).Different browsers combines their own stylesheet language to provide the control of page effect for user.Initial HTML only includes seldom display properties.
But with the growth of HTML, in order to meet the requirement of page designer, HTML is added to many display functions. With the increase of these functions, HTML becomes more and more mixed and disorderly, and html page is also more and more too fat to move.In order to solve this ask Topic, World Wide Web Consortium (World Wide Web Consortium, referred to as: W3C) develop cascading style sheets (Cascading Style Sheets, referred to as: CSS).CSS is responsible in webpage in standard web page design as a kind of computer mark language The performance of appearance, CSS can accurately control the position typesetting of display object each in webpage, support almost all of word Body, font size, pattern.
It generally uses HTML combination CSS code to be edited when designing webpage at present, effectively improves webpage design Efficiency.
As the formation of webpage habit is checked in the increase and user of new web page exploitation demand, on mobile terminal or desktop computer The function of many webpages is similar.If Fig. 1 is to show a kind of schematic layout pattern of webpage design according to prior art.Such as Shown in figure, in page layout, one column of upper left face is equipped with APP downloading, geographical location, weather etc. and shows content;One column of upper right face Equipped with tabss such as user's login, problem feedback and webpage closings.There are " recommendation ", " hot spot ", " figure in Web page text part The tabss such as piece ", " science and technology ", " amusement ", " game ", the corresponding information content of right side Show Tabs of these tabss.
In page layout exploitation design process, when developing new web page every time, although the function of realizing every time has very greatly Similitude, but all from the beginning write one time realize layout code.
Therefore, the model code of repeatability can be write for similar layout in webpage design.This design method is deposited The problem of be that, in page development, layout can occupy more time, reduce the efficiency of webpage development.
Summary of the invention
For the low problem of page layout development efficiency in the prior art, the invention discloses a kind of page layout method and Page layout device.
A kind of page layout method, which comprises
Step 1, the form of expression for determining page layout;
Step 2, according to the determining form of expression, utilize flex attribute configuration layout pattern;
Step 3 utilizes the layout pattern layout page.
Further, the form of expression described in the step 1 include: left-justify, Right Aligns, horizontal center, vertical center, Horizontal vertical is placed in the middle, adaptively the right both ends of multiple text exhibitions, a first from left are aligned a line, a line left side is fixed, the right polishing, one One or more of fixed intermediate polishing of the fixed left side polishing in row the right, a line left and right side.
Further, in the step 2, internal web page element is converted into flex project in flex container.
Further, in the step 2, flex project is determined based on the trunnion axis and intersecting axle of the flex container Position.
Further, in the step 2, the size and size of flex project are determined in flex project.
Further, flex attribute configuration layout pattern is utilized in the step 2 specifically:
Definition display box type;
Determine the browser that box can be compatible with;
Determine display box properties;
Layout pattern is determined according to display box type, display box properties.
Further, the direct element of father's element is chosen using CSS selector.
A kind of page layout device, described device include:
Determination unit, for determining the form of expression of page layout;
Configuration unit for obtaining the form of expression from determination unit, and utilizes flex attribute configuration layout pattern;
Layout units, for the layout pattern layout page using the configuration unit.
Further, the configuration unit is also used to determine flex based on the trunnion axis and intersecting axle of the flex container Item destination locations and/or size.
A kind of page layout device, the page layout device include processor, memory, and the processor is deposited with described Reservoir is connected by bus, wherein
Computer program code is stored in the memory, the processor executes the computer program code in memory To execute method described in any of the above embodiments.
According to the technical solution of the present invention, the code of unified layout pattern has been used during similitude webpage development, Effectively improve webpage development efficiency.Other features and advantages of the present invention will be illustrated in the following description, also, portion Divide ground as will become apparent from the description, or understand through the implementation of the invention.The objectives and other advantages of the invention can It is achieved and obtained by structure pointed in the specification, claims and drawings.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is this hair Bright some embodiments for those of ordinary skill in the art without creative efforts, can be with root Other attached drawings are obtained according to these attached drawings.
The layout that Fig. 1 shows a kind of webpage design according to prior art shows schematic diagram;
Fig. 2 shows a kind of page layout method basic flow charts according to an embodiment of the present invention;
Fig. 3 shows structure of container conceptual schematic view according to an embodiment of the present invention;
Fig. 4 shows the page structure effect according to an embodiment of the present invention formed according to the automatic polishing layout pattern in the left side Figure;
Fig. 5 shows the page structure effect picture according to an embodiment of the present invention that layout pattern formation is aligned according to both ends;
Fig. 6 shows a kind of page layout structure drawing of device according to an embodiment of the present invention;
Fig. 7 shows another page layout structure drawing of device according to an embodiment of the present invention.
Specific embodiment
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with the embodiment of the present invention In attached drawing, technical solution in the embodiment of the present invention clearly and completely illustrated.Obviously, described embodiment is A part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art Every other embodiment obtained without making creative work, shall fall within the protection scope of the present invention.
In the embodiment of the present invention, the various forms of expression such as left-justify, the Right Aligns of webpage layout layout are abstracted, shape At many forms.Layout pattern is write according to multiple forms of expression of abstract formation, with the flex in CSS (flexible box, referred to as: elasticity layout BOX Model) elasticity layout can be achieved layout, automatic polishing, etc. than division etc. it is a variety of Page Container.Finally, then being compiled with the layout pattern finished writing above according to the distribution form of the design drawing paging of the page Write the page.
Page layout method basic flow chart according to an embodiment of the present invention as shown in Figure 2.Page layout as shown in the figure Method may include steps of:
Step 1, the form of expression for determining page layout.
Webpage is made of web page element, and web page element includes the various elements such as text, picture, audio, animation, video.For The beauty of Webpage, needs to be laid out above-mentioned web page element.The arrangement of each web page element in webpage layout layout There are many forms, including left-justify;Right Aligns;Horizontal center;Vertical center;Horizontal vertical is placed in the middle;A line is adaptive Multiple text exhibitions;One the first from left is right, both ends alignment;A line left side is fixed, the right polishing;It is fixed on the right of a line, left side polishing;One Row left and right side is fixed, intermediate polishing etc..
In webpage layout design, the form of expression of page layout is determined according to demand first.Without loss of generality, of the invention Embodiment for the form of expression and the Justified form of expression that determine the automatic polishing in the left side to illustrate.
Step 2, according to the determining page layout form of expression, utilize the flex attribute configuration layout pattern in CSS.
Flex layout container (flex container) is used in the embodiment of the present invention to configure layout pattern.In flex In container, internal web page element automatically becomes flex project (flex item).Fig. 3 shows according to an embodiment of the present invention Structure of container conceptual schematic view, as shown in figure 3, flex layout container possesses two stealthy axis, it is horizontal main shaft respectively (main axis) and vertical intersecting axle (cross axis).The intersection point of the position that main shaft starts, i.e. main shaft and left frame claims For main shaft starting point (main start);The intersection point of the position that main shaft terminates, i.e. main shaft and left frame, referred to as main shaft terminal (main end);The crosspoint of the position that intersecting axle starts, i.e. intersecting axle and upper side frame, referred to as intersecting axle starting point (cross start);It hands over The crosspoint of the position that fork shaft terminates, intersecting axle and lower frame, referred to as intersecting axle terminal (cross end).Flex project is by master Axis or intersecting axle arrangement, the width that Flex project occupies on major axes orientation are known as project main shaft width (main size), are handing over The width occupied on fork shaft direction is known as project and intersects axial extent (cross size).Pass through the main shaft width and the intersection Axial extent can determine the size of the project, and can be configured based on main shaft and intersecting axle to project, with determination Relative position of the Flex project in webpage.
The embodiment of the present invention is according to the layout pattern of the structure setting web page element of above-mentioned felx container.Without loss of generality, It is illustrated so that the automatic polishing in the web page element left side and both ends are aligned two kinds of forms of expression as an example.
The form of expression of polishing automatic for the left side is mended automatically using the flex attribute setting web page element left side in CSS Neat layout code: class l-r-r is established
Wherein, in above-mentioned code:
Display: the display box type of Element generation when establishing layout for defining;Display attribute can specify that member The box type that element should generate, can be used the flex attribute of CSS3 in the first CSS code, and flex attribute can configure layout Its whether scalable size of pattern, scalable element can abridge or amplify with the diminution or expansion of layout pattern, use Flex attribute can complete the configuration of layout pattern, so that mask layer element can be shown according to the layout pattern, due to bullet Window layer element is nested in mask layer element, therefore the pop-up layer element can also be configured according in the first CSS code Layout pattern show;
- webkit: for the various browsers such as Google's chrome browser, apple safari browser, Firefox, IE Kernel identification code, such as in "-webkit-box ", add "-webkit " to indicate that box pattern can be compatible with chrome before " box " clear Look at device;
Box: its whether scalable size of daughter element of frame is provided for flex attribute;
Flex: for the newly added box model attribute of css3, it can solve the layout by various structures, css realization Mode.A classical layout application, which is exactly that be laid out vertical is contour, horizontal, divides equally, divides in proportion etc.;
.l-r-lr > *: for a kind of CSS selector, presentation selector is used to choose the element with particular parent element, if Element is not the direct daughter element of father's element, then will not be selected;
Block: being the value of display attribute, indicates: this element will be displayed as block grade element, can have before and after this element Newline;
Flex:1, expression allow the daughter element of all elastic BOX Model object to have identical length, ignore their inside Content.
If Fig. 4 is shown, according to the page structure effect picture of the automatic polishing layout pattern formation in the above-mentioned left side.Such as Fig. 4 institute Show, in Webpage, page elements (such as control) are on the right side of the page, and automatic polishing has been made in left side.
For the Justified form of expression, layout code is aligned using the flex attribute setting both ends in CSS: establishing class l-r-lr
Wherein, in above-mentioned code:
Box-pack:justify: it is that box-pack attribute provides to be greater than the dimensions of daughter element when frame, wherein places son Element.
Justify: for the one of attribute value of box-pack, extra space is divided in expression between each daughter element (before first daughter element and there is no extra space after the last one daughter element);
Justify-content:justify-content is for being arranged or retrieving elastic box element at main shaft (horizontal axis) Alignment thereof on direction, possible values have flex-start (left-justify), flex-end (Right Aligns), center (placed in the middle Alignment), space-between (both ends alignment), space-around (being uniformly distributed along axis);
Space-between: for the one of attribute value of justify-content, indicate: the project of expression is located at each row Between there are in the container of blank;
.l-r-lr > *: being a kind of CSS selector, and presentation selector is used to choose the element with particular parent element;If Element is not the direct daughter element of father's element, then will not be selected.
If Fig. 5 is shown, the page structure effect picture that layout pattern is formed is aligned according to above-mentioned both ends.As shown in figure 5, In In Webpage, page elements realize the alignment of left and right side in page left and right sides.Vividerly, as shown in Figure 1, figure In the page elements such as " downloading APP ", " Beijing ", " cloudy day ", " 11 °/16 ° " be located at left side, " login ", " feedback ", " × (closing Webpage) " for element on the right side of the page, both ends alignment is realized in the left and right sides.
In the embodiment of the present invention, exemplary theory is carried out so that the automatic polishing in the left side and both ends are aligned two kinds of forms of expression as an example It is bright, but it is not limited to the above two form of expression, but can be adaptively adjusted according to container attribute, item attribute etc.. Wherein, container attribute includes major axes orientation attribute (flex-direction), project alignment attribute (flex-wrap), laterally row Column Properties (flex-flow), project are in the alignment thereof (justify-content) of main shaft, project in the alignment side of intersecting axle Alignment thereof (align-content) of the multirow project in intersecting axle when formula (align-items), more main shafts;Item attribute packet Include ranking of projects (order), whether project amplifies (flex-grow), whether project reduces (flex-shrink), project The taking up space (flex-basis) of main shaft, project intersecting axle alignment thereof (align-self).
Step 3 is laid out webpage using the layout pattern.
Layout pattern is run, to realize to page layout format.
The embodiment of the present invention additionally provides a kind of page layout device based on the above method, as shown in fig. 6, described Device includes determination unit, configuration unit and layout units, wherein the determination unit is used to determine the performance shape of page layout Formula, the configuration unit are laid out sample for obtaining the form of expression from the determination unit, and using flex attribute configuration Formula, further the configuration unit is also used to determine the position of flex project based on the trunnion axis and intersecting axle of the flex container It sets and/or size;The layout units are used for the layout pattern layout page using the configuration unit.
The embodiment of the present invention additionally provides a kind of page layout device based on the above method, as shown in fig. 7, described Page layout device includes processor, memory, wherein the processor is connected with the memory by bus, it is described to deposit Computer program code is stored in reservoir, the processor executes the computer program code in memory to execute any of the above Method described in.
Although the present invention is described in detail referring to the foregoing embodiments, those skilled in the art should manage Solution: it is still possible to modify the technical solutions described in the foregoing embodiments, or to part of technical characteristic into Row equivalent replacement;And these are modified or replaceed, various embodiments of the present invention technology that it does not separate the essence of the corresponding technical solution The spirit and scope of scheme.

Claims (10)

1. a kind of page layout method, which comprises
Step 1, the form of expression for determining page layout;
Step 2, according to the determining form of expression, utilize flex attribute configuration layout pattern;
Step 3 utilizes the layout pattern layout page.
2. page layout method according to claim 1, wherein
The form of expression described in the step 1 include: left-justify, Right Aligns, horizontal center, vertical center, horizontal vertical it is placed in the middle, A line adaptively fix, be fixed left on the right of the right polishing, a line by the right both ends alignment of multiple text exhibitions, a first from left, a line left side One or more of fixed intermediate polishing of side polishing, a line left and right side.
3. page layout method according to claim 1, wherein
In the step 2, internal web page element is converted into flex project in flex container.
4. page layout method according to claim 1 or 3, wherein
In the step 2, trunnion axis and intersecting axle based on the flex container determine flex destination locations.
5. page layout device according to claim 3, wherein
In the step 2, the size and size of flex project are determined in flex project.
6. page layout method according to claim 1, wherein
Flex attribute configuration layout pattern is utilized in the step 2 specifically:
Definition display box type;
Determine the browser that box can be compatible with;
Determine display box properties;
Layout pattern is determined according to display box type, display box properties.
7. page layout method according to claim 1, wherein
The direct element of father's element is chosen using CSS selector.
8. a kind of page layout device, described device include:
Determination unit, for determining the form of expression of page layout;
Configuration unit for obtaining the form of expression from determination unit, and utilizes flex attribute configuration layout pattern;
Layout units, for the layout pattern layout page using the configuration unit.
9. page layout device according to claim 8, wherein
The configuration unit, be also used to determine based on the trunnion axis and intersecting axle of the flex container flex destination locations and/ Or size.
10. a kind of page layout device, the page layout device includes processor, memory, and the processor is deposited with described Reservoir is connected by bus, wherein
Computer program code is stored in the memory, the processor executes the computer program code in memory to hold The described in any item methods of row claim 1-7.
CN201810462460.4A 2018-05-15 2018-05-15 A kind of page layout method and device Pending CN110489117A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810462460.4A CN110489117A (en) 2018-05-15 2018-05-15 A kind of page layout method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810462460.4A CN110489117A (en) 2018-05-15 2018-05-15 A kind of page layout method and device

Publications (1)

Publication Number Publication Date
CN110489117A true CN110489117A (en) 2019-11-22

Family

ID=68545207

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810462460.4A Pending CN110489117A (en) 2018-05-15 2018-05-15 A kind of page layout method and device

Country Status (1)

Country Link
CN (1) CN110489117A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111177602A (en) * 2019-12-04 2020-05-19 思齐芙蓉教育集团(湖南)有限公司 Method and system for paging typesetting of webpage content
CN111651162A (en) * 2020-08-10 2020-09-11 宁波均联智行科技有限公司 Page layout auxiliary development method and system based on screen size
CN113536179A (en) * 2021-06-21 2021-10-22 北京达佳互联信息技术有限公司 Page generation method and device, electronic equipment and storage medium
CN114675924A (en) * 2022-05-26 2022-06-28 云账户技术(天津)有限公司 Page layout method and device based on FlexBox and electronic equipment
CN117149200A (en) * 2023-10-31 2023-12-01 北京大学 Method, device, equipment and storage medium for drawing interface grid of An Zhuo Duan
CN117289937A (en) * 2023-11-27 2023-12-26 成都中科极云软件有限公司 Method and system for realizing linkage of internal and external data of layout container in low-code platform

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20130019089A (en) * 2011-08-16 2013-02-26 권오석 Webpage making method and system for personalized service shopping mall
CN106168978A (en) * 2016-07-25 2016-11-30 腾讯科技(深圳)有限公司 The treating method and apparatus of pop-up in a kind of webpage
CN106874193A (en) * 2017-01-09 2017-06-20 深圳市赛亿科技开发有限公司 A kind of method and system of detection flex layout attributes integralities

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20130019089A (en) * 2011-08-16 2013-02-26 권오석 Webpage making method and system for personalized service shopping mall
CN106168978A (en) * 2016-07-25 2016-11-30 腾讯科技(深圳)有限公司 The treating method and apparatus of pop-up in a kind of webpage
CN106874193A (en) * 2017-01-09 2017-06-20 深圳市赛亿科技开发有限公司 A kind of method and system of detection flex layout attributes integralities

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
岳丹丹: "网页浮动布局方式和伸缩盒布局方式的比较研究", 《兴义民族师范学院学报》 *
林文如等: "基于弹性盒子模型的跨平台手机应用界面布局", 《苏州大学学报(工科版)》 *
黄新艳: "微信小程序开发中flex布局容器及元素之属性技术释疑", 《信息与电脑(理论版)》 *

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111177602A (en) * 2019-12-04 2020-05-19 思齐芙蓉教育集团(湖南)有限公司 Method and system for paging typesetting of webpage content
CN111651162A (en) * 2020-08-10 2020-09-11 宁波均联智行科技有限公司 Page layout auxiliary development method and system based on screen size
CN113536179A (en) * 2021-06-21 2021-10-22 北京达佳互联信息技术有限公司 Page generation method and device, electronic equipment and storage medium
CN113536179B (en) * 2021-06-21 2023-12-26 北京达佳互联信息技术有限公司 Page generation method and device, electronic equipment and storage medium
CN114675924A (en) * 2022-05-26 2022-06-28 云账户技术(天津)有限公司 Page layout method and device based on FlexBox and electronic equipment
CN114675924B (en) * 2022-05-26 2022-08-19 云账户技术(天津)有限公司 Page layout method and device based on FlexBox and electronic equipment
CN117149200A (en) * 2023-10-31 2023-12-01 北京大学 Method, device, equipment and storage medium for drawing interface grid of An Zhuo Duan
CN117149200B (en) * 2023-10-31 2024-01-23 北京大学 Method, device, equipment and storage medium for drawing interface grid of An Zhuo Duan
CN117289937A (en) * 2023-11-27 2023-12-26 成都中科极云软件有限公司 Method and system for realizing linkage of internal and external data of layout container in low-code platform
CN117289937B (en) * 2023-11-27 2024-01-26 成都中科极云软件有限公司 Method and system for realizing linkage of internal and external data of layout container in low-code platform

Similar Documents

Publication Publication Date Title
CN110489117A (en) A kind of page layout method and device
CN105373567B (en) Page generation method and client
McFarland CSS3: the missing manual
Frain Responsive web design with HTML5 and CSS3
US10185782B2 (en) Mode identification for selective document content presentation
CN106294664A (en) A kind of method and apparatus generating mind map
CN104809123B (en) A kind of webpage rendering method and system
WO2015196822A1 (en) Method and device for adapting webpage to screen layout
CN102609256A (en) Motion chart generating method based on webpages
CN105138568B (en) Search result shows method, apparatus and search engine
CN103970859A (en) Google user map text labeling method based on SVG
CN111104117A (en) Page theme style switching method and device, electronic equipment and computer storage medium
CN109683978A (en) A kind of method, apparatus and electronic equipment of the rendering of streaming layout interface
CN108959495A (en) Page display method, device, equipment and the computer storage medium of H5 webpage
KR102574306B1 (en) dynamic typesetting
CN103136175A (en) Page dividing method of reading materials of electronic publication (Epub) form and system using the same
CN107562455B (en) A kind of HTML list self-adaptive layout method and device
CN111539186A (en) Big data tree component implementation method and system applied to HTML5
Weyl What's new in CSS3
Bryant et al. Pro HTML5 Performance
CN110309449A (en) Page rendering method and device
Dutson Responsive mobile design: Designing for every device
CN111061980A (en) Self-adaptive layout method based on BFC characteristics
Aryal Bootstrap: a front-end framework for responsive web design
JP2019046191A (en) Information display program, information display method, terminal device, and distribution device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20191122