Skip to content

Instantly share code, notes, and snippets.

@spencermathews
Created January 22, 2016 01:07
Show Gist options
  • Save spencermathews/f19ed9aeab3ebc8088e1 to your computer and use it in GitHub Desktop.
Save spencermathews/f19ed9aeab3ebc8088e1 to your computer and use it in GitHub Desktop.
1-jQuery change background
<section>
<nav>
<ul>
<li></li>
<li></li>
<li></li>
</ul>
</nav>
</section>
$(document).ready(function(){
//console.log("ready");
//change a css property
$('body').css('background-color','#65B6D6');
});
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
* {
margin:0px;
padding:0px;
}
body {
background-color:white;
}
section{
width:4in;
margin:2in auto 0 auto;
}
ul {
box-shadow:5px 5px 5px #444;
border-radius:20px;
}
li {
list-style-type:none;
height:1in;
background-color:#333;
border-bottom:#CCC 1px solid;
}
li:first-child {
border-top-left-radius:20px;
border-top-right-radius:20px;
}
li:last-child {
border-bottom-left-radius:20px;
border-bottom-right-radius:20px;
border-bottom:none;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment