Home > other >  How to change the background color using tkinter.Label
How to change the background color using tkinter.Label

Time:10-20

I'm trying to build GUI program and want to know who to change the label background color?

import tkinter as tk

window = Tk()

timer_label = Label(text="Timer", fg=GREEN, font=(FONT_NAME, 50, "normal"))
timer_label.pack()

root.mainloop()

CodePudding user response:

To change the background you can use the "bg" for expmle:

timer_label = Label(text="Timer", fg=GREEN, bg="red" font=(FONT_NAME, 50, "normal"))
  • Related