background-position-y property
Specifies the vertical-coordinate of the background-image relative to the upper-left corner of the container object.
This property is not supported by all browsers, so use background-position property instead wherever you can.
JavaScript page for this property: backgroundPositionY. You can find other example(s) there. |
Possible values:
One of the following values:
Background is aligned to the bottom. | |||||||
Background is vertically centered. | |||||||
The vertical position of the background in length units. For the supported length units, see the length page. | |||||||
The vertical position is the specified percentage of the height of the object. | |||||||
Background is aligned to the top. |
Default: 0%.
Example HTML code 1:
This example illustrates the use of the background-position-y property:
|
||||
<head> <style> .example { background-image: url("bg.jpg"); background-repeat: no-repeat; width: 200px; height: 200px; border:1px solid #CCCCCC; background-position-x: center; } .top { background-position-y: top; } .bottom { background-position-y: bottom; } </style> </head> <body> <div class="example top" style=" float:right;"> The image is at the top of this division. </div> <div class="example bottom"> The image is at the bottom of this division. </div> </body> |
||||
|
||||
Did you find this example helpful?
|
Supported by tags:
a, abbr, acronym, address, b, bdo, big, blockQuote, body, button, caption, center, cite, code, col, colGroup, dd, del, dfn, dir, div, dl, dt, em, fieldSet, font, form, H1, H2, H3, H4, H5, H6, hr, html, i, iframe, img, input:button, input:checkbox, input:file, input:image, input:password, input:radio, input:range, input:reset, input:search, input:submit, input:text, ins, isIndex, kbd, label, legend, li, listing, marquee, menu, nobr, ol, p, pre, q, rt, ruby, s, samp, small, span, strike, strong, sub, sup, table, tBody, td, textArea, tFoot, th, tHead, tr, tt, u, ul, var, xmp
Related pages:
background
background-attachment
background-color
background-image
background-position
background-position-x
background-repeat
background-attachment
background-color
background-image
background-position
background-position-x
background-repeat
External links:
User Contributed Comments