开发者

Make a background image the height of the taller div with CSS

I开发者_运维问答 have a layout with a variable-length menu on the left, and variable-length content on the right. In between the menu and content is a divider implemented using a repeating background image, which is part of the content div. This means that as the content expands or contracts, so does the divider.

If the height of the content is less than the height of the menu, the divider is still the height of the content, when what I really want is the divider to be the height of the menu in this case. Is there any way to implement this in CSS?


Have the dividers background image in the content are and the menu and have the content area overlap the menu the width of the divider using negative margins or something similar.


An alternative would be to use the background image on a wrapper div and use background-position to place it between the menu and content divs.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜