# How do I change the background of a Frame in Tkinter?

TkinterPythonServer Side ProgrammingProgramming

In order to change the background color and foreground color of a tkinter frame, we can assign different values to the bg and fg parameters in the Frame function.

## Example

In this example, we have created two frames with different background colors.

#Import the required libraries
from tkinter import *

#Create an instance of tkinter frame
win= Tk()

#Set the geometry of frame
win.geometry("650x250")

#Create an frame
frame1= Frame(win, bg= "red")
frame2= Frame(win, bg="black")

#Create an label inside the frame
win.mainloop()