In CKEditor, how can I add a “text” label to a button?

前端 未结 4 1037
旧巷少年郎
旧巷少年郎 2021-02-05 15:19
editor.ui.addButton( \'ImageUpload\',{
                label: \'Upload Image\',
                command: \'popup_image_uploader\',
                icon: this.path + \'im         


        
4条回答
  •  逝去的感伤
    2021-02-05 15:55

    another solution would be to just use the css ":before" or ":after" pseudo class to add some custom content before / after the buttons.

    for example, customizing the "link" button:

    create some space (depends on length of content):

    .cke_button_icon.cke_button__link_icon {
    padding-right: 25px;
    }
    

    add content:

    .cke_button_icon.cke_button__link_icon:after {
    content: "Link";
    position: relative;
    left: 15px;
    }
    

提交回复
热议问题