lecture #4: style and grace
CSS is what makes websites look pretty. It's the difference between this:
and this:
For these two websites the html is the same, the Javascript running on the browser is the same, everything which went on on the server side to render this page is the same. The only difference is that one is completely lacking css styling.
So far we've been making webpages without styling, so they look alot like ugly twitter shown above. Now we're gonna start learning how to pretty them up. Take the site which you made for HW3.
Lets add some style to it!
So open up the new_ingredient.html file in this repo, and we'll just change some css attibrutes, for a few elements. To do this we'll use the chrome inspector.
- font-size: 32px
- text-align: center
- font-family: Lucida Sans Unicode, Lucida Grande, sans-serif
- border: 4px solid black
- border-radius: 10px
- border: 2px solid green
- border: 2px solid red
- border: none
- padding-bottom: 12px
- background-image: url(http://maxim061156.files.wordpress.com/2012/09/santaclaus15.jpg)
And voila! look at our beatiful website!
So this is all great and all, but refresh the page, and what happens? All of our hard work is gone. So how do we make permanent css styles? Using a stylesheet. Fork this repo, pull it, the open up a text editor and lets make one.