You need two elements for a nested background connection (aka sliding doors): external (background) and internal (foreground containing the final element of the background image). If you only have a standalone <input>, you're stuck.
If you can find a way to select the <div, you mentioned, you can use this as an external element, while the button (with the natural color background removed) as the internal one. You need to make sure that the outer div is the same width / height as the inner <input>, although it may be floating to the left (to activate the "compressible behavior" that comes with the floats). You will also need to consider the top margin on the button and any addition to it.
#something div { float: left; background: transparent url('http://mydomain.com/projects/buttons/sliding-doors/images/bg_button_oval_a.gif') no-repeat 0 10px; } #something div input { background: transparent url('http://mydomain.com/projects/buttons/sliding-doors/images/bg_button_oval_span.gif') no-repeat; border: none; padding: 0; }
However, since this button has a fixed pixel size on the page, you do not need to use nested backgrounds at all. You can simply make one background with the correct dimers for the button.
bobince
source share