my css don't works...

my css don't works...

by Jim Lin -
Number of replies: 4

hi firends

i want wo add a navigationbar in elegance theme ,but i find my css don't work.

can any one tell me why?


Average of ratings: -
In reply to Jim Lin

Re: my css don't works...

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Without knowing what code you've written, its difficult to tell.

In reply to Gareth J Barnard

回复: Re: my css don't works...

by Jim Lin -

hi ,these are my code

i write these code in layout/includes/bar.php

<div  class="bar">
  <ul >
    <li ><a  href="#">home page</a></li>
    <li ><a  href="#">music</a></li>
    <li ><a  href="#">sports</a></li>
    <li ><a  href="#">game</a></li>
    </ul>
</div>


also i write a line in frontpage.php

    require_once(dirname(__FILE__).'/includes/bar.php');


then i write a css file in style/bar.css

.bar{
       margin:50px auto;
       border-top:2px solid #000;
       border-bottom:2px solid #000;
    }
.bar>ul{
       margin:0 auto;
       list-style:none;
       position:relative;
       width:960px;
}

.bar>ul>li>a{
         display:block;
         width:100px;
         text-align:center;
         text-decoration:none
}
.bar>ul>li{
display:inline-block;
}

in config.php

$THEME->sheets = array('bar',
                           'font-awesome',
                           'google-fonts',
                           $categorysheet,
                           $loginsheet,
                           'nprogress',
                           'elegance',
                           'mobile');

so,can you tell me where is wrong...( ▼-▼ )






In reply to Jim Lin

Re: 回复: Re: my css don't works...

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Thanks, I see what you are doing, so instead of using your own class, read this: http://getbootstrap.com/components/#navbar instead.

In reply to Gareth J Barnard

回复: Re: 回复: Re: my css don't works...

by Jim Lin -

ok,thank you.I will study this and have a try.

But i really want to know why my css dont work......

I spent a week to solve this problem ,but field sad