如何解决在Bootstrap 4导航栏中更改超链接的文本颜色
这是用于导航栏的代码段
import ntpath
import tkinter as tk
from PIL import Image,ImageTk
root = tk.Tk()
root.geometry("800x600")
#for storing image references
images = dict()
#list of your image paths
pathlist = ['D:\image1.png','D:\image2.png']
#load paths and save references
for path in pathlist:
name = ntpath.basename(path).split('.')[0]
images[name] = ImageTk.PhotoImage(Image.open(path),name=name)
#you can assign an image with just the name
labela = tk.Label(root,image='image1')
labela.grid()
#or directly through the images reference
labelb = tk.Label(root,image=images['image2'])
labelb.grid()
root.mainloop()
我尝试将一个类分配给颜色为“白色”的'a'元素,但无法正常工作。
解决方法
使用引导文本类。
尝试对标签text-white
的类<a class="nav-link text-white" href="#">About</a>
您的代码无法正常工作,因为Bootstrap类具有更高的特异性。引导程序规则包含!important
引导程序类
.text-white {
color: #fff!important;
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。