gpt4 book ai didi

html - 将 CSS 类应用于文本

转载 作者:太空宇宙 更新时间:2023-11-04 09:27:02 25 4
gpt4 key购买 nike

在我的主页上http://www.rosstheexplorer.com/文本“新南威尔士州”、“维多利亚州”、“北领地”、“南澳大利亚州”、“昆士兰州”、“澳大利亚旅游指南”、“其他澳大利亚博客”都应以粗体显示并居中。很长一段时间都是这样,今天我发现情况不再是这样了。我以为我在页面上犯了一个错误,但后来意识到这个问题已经开始出现在整个网站上。

以下代码用于工作。

<div class="BlackIcon">New South Wales</div>
<div class="BlackIcon">Victoria</div>

注意:您可能需要单击蓝色文本才能查看屏幕截图。

The text 'New South Wales' is still associated with the CSS class 'BlackIcon' but now it is not inheriting the properties from the CSS class.

/*To be used on its own, it has 100% width so you no longer need a guide css as well*/
@media screen and (max-width: 9999999px) {
.BlackIcon {
color: Black;
background-color: White;
border-radius: 20px;
margin-top: 15px;
margin-bottom: 5px;
padding: 10px;
font-size: 2em;
text-align: center;
display: inline-block;
border: 0 solid black;
width: 100%;
font-weight: 500;
}
}

谁能解释一下是什么导致了这个问题?

最佳答案

问题是您的自定义样式表有语法错误。

尝试将整个样式粘贴到所选的语法检查器中(例如 http://csslint.net)

注意红色三 Angular 形;这些是解析错误,通常会导致其余样式被浏览器忽略。

样式表中有两个杂散的 } 字符。如果你只删除这两行,你应该没问题。它们可以在 .BlackIcon 规则上方的几行中找到,这可以解释为什么该规则不起作用。

关于html - 将 CSS 类应用于文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41015188/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com