Method and device for generating labels

The invention discloses a method for generating labels, which comprises the steps of: obtaining information of a label to be generated; generating the label at a random position on a terminal screen according to the information of the label; judging whether the position of the label satisfies a preset condition, if not, re-generating a new label, and performing the step of judging whether the position of the label satisfies the preset condition until generating a label satisfying the preset condition. The embodiment of the invention generates the label at the random position on the terminal screen according to the information of the label, judges whether the position of the label satisfies a preset condition, if not, re-generates a new label, and performs the step of judging whether the position of the label satisfies the preset condition until generating a label satisfying the preset condition, thereby realizing the flexible adjustment of the label position to enable the label to appear on different positions on a page displayed by a terminal, improving the attention of users on different webpage contents and increasing user experience by the adjustment of the label position.