# -*- coding: utf-8 -*- import tkinter as tk import tkinter.ttk as ttk root = tk.Tk() root.title("tk21.py") root.geometry("200x120") ##################################### ttk.Style().configure('A.TLabel',padding = 5, relief = 'sunken', background = 'pink', foreground = 'red') ttk.Style().configure('B.TLabel',padding = 5, relief = 'raised', background = 'green', foreground = 'blue') ttkLb1 = ttk.Label(root, text = "ttk Label_1", style = 'A.TLabel') ttkLb2 = ttk.Label(root, text = "ttk Label_2", style = 'B.TLabel') ttkLb3 = ttk.Label(root, text = "ttk Label_3", style = 'A.TLabel') ttkLb1.pack() ttkLb2.pack() ttkLb3.pack() ##################################### root.mainloop()