0

Im using bootstrap with my custom css. the problem is that some styling from my custom css is applied only after i shrink my website with my browser, it adapts to smaller browser size and it applies my custom css, that same css dosent apply when website is in full size.

I uploaded a picture here. you can see how text on the right side has styling. it happens also with menu items, but the wierd thing is that on some places it works normaly before and after shrinking the page, for example look at the picture at the background of login and contact forms, its my custom css gradient and it works in both cases, also the buttons work normally. can you help me somehow couse im confuzed how this works?

btw i dont know if it is important at all in this case but im using joomla 2.5 here

4

1 回答 1

2

如果它只适用于某个宽度,则意味着您的自定义 CSS 在媒体查询中。

我怀疑您的 CSS 某处有错误。我自己也遇到过这种情况,我无意中没有关闭媒体查询,这意味着样式表中流过它的所有 CSS 仅适用于那些媒体查询约束。

查看您的 CSS 并确保您的所有媒体查询都正确关闭。您还可以使用W3 CSS Validator验证您的 CSS 文件- 这应该有助于确定错误所在。

另外值得一提的是:当我使用 Bootstrap 时,我总是为我的工作使用完全独立的样式表(在需要的地方重复类以覆盖 Bootstrap 样式)。如果您将所有当前样式提取到一个单独的文件中,它将使调试更加容易,并且还可以消除您当前遇到的问题(您的样式似乎嵌入在媒体查询中)。

于 2013-05-23T12:14:59.877 回答