Week 9
You can effect all four sizes of the box
To add rounded corners:
note: not supported in ie 8 or below
You can add a photo for a border:
By default, overflow is set to visible which allows content to "break" outside the box when it has a specific height.
You can change how an element is displayed
box-shadow: 6px 5px 5px 6px #4444;
will have to use vendor prefixes.
inline elements
block level elements
Clears floated elements and returns it to it's natural state
clear:(left, right, both, none, inherit)
Demo
position: (static, relative, absolute, fixed, inherit)
You also have to specify where you what the element moved.
top, right, bottom, left
top: 10px;
z-index: (number, auto, inherit)
demo
You can control the width and height of an image via CSS
img {
width: 100px;
height: 200px;
}
img.large{
width: 100%;
height: 200%;
}
You can also align images using the float property or by using margin: 0px auto to center them
img.left {
float:left
}
img.center{
display: block;
margin: 0px auto;
}
You can set images as background and control if they repeat and their position
You can also use the shorthand version
Order:
1. Color
2. Image URL
3. Repeat
4. Attachment
5. Position
You can set an image as a background and repeat it as a pattern.
body {
background: url (images/background.jpg) no-repeat;
}
body {
background: url (images/background.jpg) repeat-y;
}
You can also call multiple background images. The image called first will be placed infront.
background-image: url(kittens.jpg), url(dogs.jpg);
background-position: left top, center top;
background-repeat: no-repeat, repeat-y;
demo
New to CSS3, you can create radial and linear gradients
background-image: linear-gradient (180deg, yellow, green)
background-image:radial-gradient (center contain yellow green)
Gradients can be difficult to understand and create, but there are tools out there that will help you generate them:
http://www.colorzilla.com/gradient-editor/
http://www.cssbuttongenerator.com/
Are applied to already existing classes
Are applied to already existing classes
p:before{
content:"Once upon a time";
font-weight:bold;
color:purple;
}
img[title]{border3px solid #555;}
input[type="text"]{border:1px solid #444;}
img[title="kittens"]