Page 115 - DCAP408_WEB_PROGRAMMING
P. 115
Unit 4: Cascading Style Sheets
Notes
background-color
background-image
background background-repeat
background-attachment
background-position
background-attachment scroll | fixed
color-rgb
color-hex
background-color
color-name
Transparent
url
background-image
None
top left | top center | top right | center left | center center |
center right | bottom left | bottom center | bottom right
background-position
x-%y-%
x-pos y-pos
background-repeat repeat | repeat-x | re- peat-y | no-repeat
Example:
EM {color: red} /* natural language */
EM {color: rgb (255,0,0)} /* RGB range 0-255 */
H1 {background-color: #F00}
BODY {background-image: url (marble.gif)}
P {background-image: none}
BODY {background: red url (pendant.gif);
background-repeat: repeat-y;
}
BODY {background: red url (pendant.gif);
background-repeat: repeat-y;
background-attachment: fixed;
}
BODY {background: url (banner.jpeg) right top} /* 100% 0% */
BODY {background: url (banner.jpeg) top center} /* 50% 0% */
BODY {background: url (banner.jpeg) center} /* 50% 50% */
BODY {background: url (banner.jpeg) bottom} /* 50% 100% */
BODY {background-image: url (logo.png);
background-attachment: fixed;
background-position: 100% 100%;
}
BODY {background: red}
P {background: url (chess.png) gray 50% repeat fixed}
LOVELY PROFESSIONAL UNIVERSITY 109