Easy Tutorial
❮ Css Style Priority Android Tutorial Exercise 6 Html ❯

HBuilder Tutorial

Category Programming Technology

What is HBuilder?

HBuilder is a Web development IDE supporting HTML5 launched by DCloud (Digital Paradise). HBuilder is written in Java, C, Web, and Ruby. The main body of HBuilder is written in Java and is based on Eclipse, so it naturally supports Eclipse plugins. Speed is HBuilder's biggest advantage, significantly improving the development efficiency of HTML, js, and css through complete syntax hints and code input methods, code blocks, etc.


How to Install HBuilder?

Download address for HBuilder: On the HBuilder official website http://www.dcloud.io/ click on free download to get the latest version of HBuilder.

HBuilder currently has two versions, one for Windows and one for Mac. When downloading, choose the version that suits your computer.


Using HBuilder to Create a New Project

Click on File → New → select Web Project (press Ctrl+N,W to trigger quick new (on MacOS use Command+N, then left-click on Web Project))

As shown in the figure above, please fill in the name of the new project at A, fill in (or select) the project save path at B (changing this path will be recorded by HBuilder and the changed path will be used by default next time), and select the template you want to use at C (you can click on custom template and refer to the readme.txt in the opened directory to customize the template).


Creating an HTML Page with HBuilder

In the project explorer, select the newly created project and click on File → New → select HTML File (press Ctrl+N,W to trigger quick new (on MacOS use Command+N, then left-click on HTML File)), and choose the blank file template as shown in the figure below.


Try Viewing Programming Effects with HBuilder's Live Edit Feature

On Windows, press Ctrl+P (Command+P on MacOS) to enter Live Edit mode. In this mode, if the currently opened file is an HTML file, it will automatically refresh to show the current page effect after each save (if it is a JS, CSS file, and there is a reference relationship with the page opened in the current browser view, it will also refresh).


HBuilder Code Blocks Greatly Reduce the Workload of Redundant Code

In the opened getstart.html, type H as shown in the figure below.

Then press 8 to automatically generate the basic code of HTML as shown in the figure below.

What is a code block?

A code block is a commonly used combination of code, for example, in js, type $ and press Enter, and it will automatically input document.getElementById(id).

View and edit code blocks in Tools - Customize Code Blocks, select the corresponding code block for viewing and editing. You can also click the modification icon in the lower right corner of the detailed information when activating the code block in the code assistant for modification and viewing.

-

Code Block Activation Principle 1: The first letter of consecutive words. For example: dg activates document.getElementById(""); vari activates var i=0; dn activates display: none;

-

Code Block Activation Principle 2: A whole section of HTML generally uses the name of the tag. For example, script, style, usually, typing up to 4 letters can match the required code block, there is no need to enter it completely, such as typing sc and pressing Enter, st and pressing Enter, to complete the input of script, style tags.

-

Code Block Activation Principle 3: If there are multiple code block outputs for the same tag, then add a suffix at the end. For example, meta outputs <meta name="" content=""/> but metau outputs <meta charset="UTF-8"/>, metag is the same.

-

Code Block Activation Principle 4: If the original syntax has more than 4 characters, for commonly used syntax, the activation symbol for the first word uses an abbreviation. For example, input button, abbreviated as inbutton, similarly, intext is the input box.

-

Code Block Activation Principle 5: The keyword code block in js is to add a repeated letter at the end of the keyword. For example, if you type if directly, it will prompt the if keyword, but if you type iff and press Enter, the if code block will appear. Similarly, there are forr, withh, etc. Since the funtion letters are longer, to speed up input, take fun as an abbreviation, for example, funn outputs the function code block, and funa and func respectively output anonymous functions and closures.


Flexible Shortcut Keys Make the Programming Process Keyboard-Only

The effect is shown in the figure below.

-

After creating a

❮ Css Style Priority Android Tutorial Exercise 6 Html ❯