我有一个网站,主页上的横幅在查看原始 html 时看起来像
<div class="alert alert-primary large" role="alert">Something</a><caption>More stuff</caption>
我的问题是如何增加字体大小。看起来很简单,但将主要之后的词改为大、小等,并没有真正改变。
原谅我知识匮乏。被赋予修改新网站的任务,到目前为止,还没有关于 css 存储位置的信息。在之前的网站(DotNetNuke)中,是一个文件夹
您可以使用 css 更改元素的字体大小。只需编辑您的代码
<div class="alert alert-primary large" style="font-size: 50px !important;" role="alert">Something</a><caption>More stuff</caption>
或者您可以创建一个自定义类名并将其添加到您的类属性中
打开一个<style> </style>
标签并做这样的事情
<style>
.anyNameYouWantToUseHere{
font-size:50px !important;
}`
</style>
<div class="alert alert-primary large anyNameYouWantToUseHere" role="alert">Something</a><caption>More stuff</caption>
您可以将字体大小更改为您想要的任何大小。
它可以是像素或百分比,但不仅限于这两个。我添加了重要,因为我注意到您正在使用引导程序。important
我添加的代码是强制元素获得指定的样式,而不管它以前的样式。
再次确保样式属性在类属性之后,否则类样式可以覆盖当前样式
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句