简体   繁体   English

SB Admin 2 CSS不完整

[英]SB Admin 2 CSS Incomplete

See Updates below 请参阅下面的更新

I'm having issues with metismenu not acting as a left-side menu-panel. 我遇到的问题是metismenu不是左侧菜单面板。 It stretches from left to right, almost as if it thinks it is a bootstrap3 style navbar. 它从左向右延伸,几乎就像它认为它是一个bootstrap3风格的导航栏一样。

I first encountered this when I tried to use SB Admin 2, but I see the error when just using simple metismenu code from their site. 当我尝试使用SB Admin 2时,我第一次遇到这个问题,但是当我们从他们的网站使用简单的metismenu代码时,我看到了错误。

I am using Django 1.7 我正在使用Django 1.7

Is there something simple I am missing here? 我在这里缺少一些简单的东西吗? I am using it exactly as it is used in this page: http://demo.onokumus.com/metisMenu/index.html 我正在使用它,因为它在本页中使用: http//demo.onokumus.com/metisMenu/index.html

UPDATE I was able to replicate the code in the demo. 更新我能够在演示中复制代码。 I had an issue with the CSS, but my problem still persists with the use of it in SB Admin 2 ( http://startbootstrap.com/template-overviews/sb-admin-2/ ). 我遇到了CSS的问题,但我的问题仍然存在于SB Admin 2中的使用( http://startbootstrap.com/template-overviews/sb-admin-2/ )。 I have the exact same css, code, and JS.. 我有完全相同的CSS,代码和JS ..

So I guess my question is, does Django do anything that might be messing this up before it gets to my browser? 所以我想我的问题是,Django在进入我的浏览器之前做了什么可能会弄乱它吗? I only ask as I am very new to web programming, and Django. 我只问,因为我对网络编程和Django都很陌生。

UPDATE 2 It is a CSS problem. 更新2这是一个CSS问题。 Even though I have the exact same code, using it in the same browser, one of the CSS rules isn't being applied to my code. 即使我有完全相同的代码,在同一浏览器中使用它,其中一个CSS规则没有应用于我的代码。 I have no idea why, if anyone else comes across this problem it is the sidebar rule that isn't being applied: 我不知道为什么,如果有其他人遇到这个问题,那么侧边栏规则没有被应用:

.sidebar {
    z-index: 1;
    position: absolute;
    width: 250px;
    margin-top: 51px;
}

EDIT Apparently, this may have just been a circumstantial case, because I was unable to replicate the problem when re-downloading the source. 编辑显然,这可能只是一个间接的情况,因为我无法在重新下载源时复制问题。 Either way, I will keep my solution here. 不管怎样,我会在这里保留我的解决方案。

Ok, so I feel a bit silly that it took me this long to figure it out. 好吧,所以我觉得有点傻,我花了很长时间才弄明白。

Basically the CSS in the download for SB Admin 2 is not complete. 基本上,SB Admin 2下载中的CSS不完整。 My suggestion, go to the demo site and copy the CSS from there. 我的建议,去演示站点并从那里复制CSS。 From what I can tell, it is specifically the CSS rule below that is missing: 据我所知,具体是下面的CSS规则缺失:

@media(min-width:768px) {
    .sidebar {
        z-index: 1;
        position: absolute;
        width: 250px;
        margin-top: 51px;
    }

    .navbar-top-links .dropdown-messages,
    .navbar-top-links .dropdown-tasks,
    .navbar-top-links .dropdown-alerts {
        margin-left: auto;
    }
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM