salierii
salierii

Reputation: 5

Removing this kind of frame inside the text

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:

enter image description here

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

Answers (1)

Alderven
Alderven

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:

enter image description here

Upvotes: 2

Related Questions