1

I am building a Bootstrap site and have a css (with function to show a sticky note post-it) from another project I want to implement.

When the css is loaded in the index.html, the menu in Bootstrap gets shadow effect from the sticky-css - how do I code the css to only show in ?

The sticky.css file:

@import url(http://fonts.googleapis.com/css?family=Reenie+Beanie);
@import url(http://fonts.googleapis.com/css?family=Patrick+Hand+SC);

.sticky.div:sn {
      margin: 0 auto;
}

.sticky h1,.sticky p{
  font-family:"Reenie Beanie","Ruthie";
  line-height: 100%;
  font-weight:normal;
}

.sticky ul,.sticky li{
  list-style:none;
}
.sticky  ul{
  overflow:hidden;
  padding:2em;
}

.sticky ul li{
  margin:1em;
  float:left;
}

.sticky ul li a{
  text-decoration:none;
  color:#000;
  background:#ffc;
  display:block;
  height:12em;
  width:12em;
  padding:1em;
  -moz-box-shadow:5px 5px 7px rgba(33,33,33,1);
  -webkit-box-shadow: 5px 5px 7px rgba(33,33,33,.7);
  box-shadow: 5px 5px 7px rgba(33,33,33,.7);
  -moz-transition:-moz-transform .15s linear;
  -o-transition:-o-transform .15s linear;
  -webkit-transition:-webkit-transform .15s linear;
  -webkit-transform: rotate(-6deg);
  -o-transform: rotate(-6deg);
  -moz-transform:rotate(-6deg);
}

.sticky ul li h1{
   font-family:"Reenie Beanie","Ruthie";
line-height: 90%;
  font-weight:bold;
  padding-bottom:10px;
}
.sticky ul li p{

  font-size:90%;
}

.sticky ul li:nth-child(even) a{
  -o-transform:rotate(4deg);
  -webkit-transform:rotate(4deg);
  -moz-transform:rotate(4deg);
  position:relative;
  top:5px;
  background:#cfc;
}
.sticky ul li:nth-child(3n) a{
  -o-transform:rotate(-3deg);
  -webkit-transform:rotate(-3deg);
  -moz-transform:rotate(-3deg);
  position:relative;
  top:-5px;
  background:#ccf;
}
.sticky ul li:nth-child(5n) a{
  -o-transform:rotate(5deg);
  -webkit-transform:rotate(5deg);
  -moz-transform:rotate(5deg);
  position:relative;
  top:-10px;
}
.sticky ul li a:hover,ul li a:focus{
  box-shadow:10px 10px 7px rgba(0,0,0,.7);
  -moz-box-shadow:10px 10px 7px rgba(0,0,0,.7);
  -webkit-box-shadow: 10px 10px 7px rgba(0,0,0,.7);
  -webkit-transform: scale(1.25);
  -moz-transform: scale(1.25);
  -o-transform: scale(1.25);
  position:relative;
  z-index:5;
}
.sticky ol{text-align:center;}
.sticky ol li{display:inline;padding-right:1em;}
.sticky ol li a{color:#fff;}
3
  • So you want only certain properties from your css file and not all of it? Commented Sep 8, 2015 at 18:23
  • 1
    Can you show html and working code (jsfidle/plunker etc.) ? I hope your menu doesn't use the sticky class. Commented Sep 8, 2015 at 18:26
  • I just oploaded the sticky notes I want to implement. No menu just the notes jsfiddle.net/tuukkaq/e15hfqg1 Commented Sep 8, 2015 at 18:48

2 Answers 2

2

Are you using third-party addons for bootstrap. I know of several that use the .sticky class, so there would certainly be a conflict there.

Can you rename your styles to something like .sticky-note?

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks - will try to rename the css :)
0

Just add a custom class to your unordered list like this:

<ul class="sticky-thing">
    <li><!--your sticky list items --></li>
    <li><!--your sticky list items --></li>
    <li><!--your sticky list items --></li>
    <li><!--your sticky list items --></li>
</ul>

And then add .sticky-things to all the ul tags in your custom css like this:

ul.sticky-thing li{
  margin:1em;
  float:left;
}
ul.sticky-thing li a{
  text-decoration:none;
  color:#000;
  background:#ffc;
  display:block;
  height:14em;
  width:14em;
  padding:1em;
  -moz-box-shadow:5px 5px 7px rgba(33,33,33,1);
  -webkit-box-shadow: 5px 5px 7px rgba(33,33,33,.7);
  box-shadow: 5px 5px 7px rgba(33,33,33,.7);
  -moz-transition:-moz-transform .15s linear;
  -o-transition:-o-transform .15s linear;
  -webkit-transition:-webkit-transform .15s linear;
  -webkit-transform: rotate(-6deg);
  -o-transform: rotate(-6deg);
  -moz-transform:rotate(-6deg);
}
/* other ul properties */

And your sticky css will be independent from the bootstrap css.

Here's a modified version of your jsfiddle with a dummy bootstrap navbar (menu) added along with the above codes: http://jsfiddle.net/AndrewL32/e15hfqg1/2/

3 Comments

Glad I could help :) Do mark this as the right answer by clicking the tick mark next to my answer if it helped you solve your issue.
Nice!! :) Do check out a site I co-managed Nick: raiot.in Some articles are not in English but some are. We are currently initiating a Living Wage/Minimum Wage campaign in Shillong too.
Thanks again I have really faught with thoose sticky notes :D I'll take a look at the site and get inspired :D

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.