<<

html & basics class three CSS review, backgrounds, , & the box model ...so let’s attach our CSS background background-color ● Namež (red) ● RGBž (rgb(255,0,0)) ● Hexž (#ff0000) ž TRY IT: body { background-color: #F1F2E4; } background background-image ● url(‘image.jpg’)ž background-repeatž ● repeat (default), repeat-x, repeat-y, no-repeat background-position ● leftž , center, right, top, center, bottom ● x%ž y% (0% 0% default) ● xposž ypos background-attachmentž ● scroll (default), fixed TRY IT: #menu { background-image:url('images/fabric_texture.jpg'); } text color ● hexž , RGB, or name text-align ● leftž (default), center, right, or justify ž TRY IT: h1 { color: #B55109; text-align:center; } text text-decoration ● nonež (default), overline, line-through, underline, blink text-transformž ● nonež (default), uppercase, lowercase, capitalize ž TRY IT: a { text-decoration:none; text-transform:uppercase; color: #66839E; } font-size ● defaultž size is 16px ● pxž , cm, , %, xx-small, x-small, small, medium, large, x-large, xx-large, smaller, larger font-weight ● normal(default)ž , bold, bolder, lighter, 100-900 ž TRY IT: h1 { h2, h3 { color: #B55109; color: #B55109; text-align:center; font-size:2em; font-size: 4em; font-weight:400; font-weight: 400; } } font font-family ● syntax=ž font-family:individual, family; ● familiesž include: , sans-serif, monospace, , fantasy font-style ● normal(default)ž , italic, oblique ž TRY IT: body { background-color: #F1F2E4; font-family: "Trebuchet MS", , , sans-serif; } font Custom fonts: @import & @font-face ● Allowž you to use any font, provided it’s hosted somewhere on the web. ● Manyž options: Font Squirrel, Google web fonts, TypeKit, etc. ž LET’S VISIT GOOGLE FONTS! https://www.google.com/fonts# font @import ● Canž be linked at the top of your CSS like this: @import url(http://fonts.googleapis.com/css?family=Open+Sans); ž Or in the like this: type='text/css'> ž font @import ● Oncež this declaration is in place, refer to your new fonts using font-family TRY IT: body { background-color: #F1F2E4; font-family: 'Sanchez', serif; } In h2, h3: font-family: 'Oswald', , , sans-serif; In h1: font-family: 'Oleo Script', cursive; font @import ● Oncež this declaration is in place, refer to your new fonts using font-family TRY IT: footer { font-family: 'Oswald', sans-serif; font-size: 1.5em; text-align: center; } nav ul { font-family: 'Oswald', sans-serif; font-size: 1.75em; } h1 span { font-family: 'Stint Ultra Condensed', cursive; font-size: 1.1em; } span? what?! is an HTML tag which allows you to just group some elements together. It doesn’t mean anything!

TRY IT:

Sam & Sally's Cafe

div
, like , doesn’t mean anything. It’s meant to divide up the into related parts. TRY IT:
the box model parts of a box: padding

h e i content g h t width

border