Im able to give the start position of an background image. But if i give positions for solid fill background its not working. Here is the js fiddle for that.
http://jsfiddle.net/yPVJE/
So can we set the start position and the size of an solid fill backgrounds?
Thanks!
The background-position property sets the starting position of a background image. Tip: By default, a background-image is placed at the top-left corner of an element, and repeated both vertically and horizontally.
The four-value syntax for background-position You combine length values with any of top/right/bottom/left keywords (not center). So for our example: background-position: right 20px bottom 10px; Using this, you can offset a background-image from any of the four corners of an element.
You can change the background color of an HTML element using the background-color CSS property and giving it a value of a color. With this code, the paragraphs are given a pink background.
Background PositionThe background-position property specifies the initial position where the background image will be placed inside of the element it is the background for. You can set both the horizontal and vertical position. Options for setting the horizontal position are left, right and center.
I would take a similar approach to StuR, but using background position instead of gradient points. You can then set your background position as you would usually.
div { background:linear-gradient(left, #000, #000) no-repeat 50px 50px; }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With