Reputation: 5
Here's my code:
import tkinter as tk
root = tk.Tk()
root.title("Shop")
root.geometry("500x500")
root['background'] = '#fbf5df'
label = tk.Label(root, text="Welcome to Our Shop! ", font=('Satoshi', 15), )
label.pack(padx = 20,pady = 20)
root.mainloop()
and here's how it looks like when executed:
I would like to remove the white spaces.
I am still new to the tkinter interface. I haven't tried anything yet. Thank you for your help!
Upvotes: 0
Views: 30
Reputation: 8270
You can set background color for your label same as your actual background color: bg='#fbf5df'
:
import tkinter as tk
root = tk.Tk()
root.title("Shop")
root.geometry("500x500")
root['background'] = '#fbf5df'
label = tk.Label(root, text="Welcome to Our Shop! ", font=('Satoshi', 15), bg='#fbf5df')
label.pack(padx=20, pady=20)
root.mainloop()
Output:
Upvotes: 2