If you really-really need to achieve this with background image, here is an example. Of course it doesn't work everywhere — you need JS polyfill to make browser that don't support background-size property happy. I would recommend jQuery Backstretch for this.
But, what you really want to do (I hope so, at least) is to make it as flexible as possible and thus, you should take a look at this or this CSS gradients tutorial instead of the image. And, of course, you can use one of the CSS gradients generator like:
.topbar{
position:relative;
top:0px;
left:0px;
height:30px; /* or whatever height you want */
}
应用您的颜色并以您认为合适的方式设置酒吧的边框。
I would do it using a div or other element at the top of the page to give you the 'bar' and use a gradient background image, attached to the body in your css, aligned to the bottom and repeated.
发布评论
评论(3)
http://gradients.glrzad.com/
或
http://www.w3schools.com/css/css_background.asp
http://gradients.glrzad.com/
OR
http://www.w3schools.com/css/css_background.asp
如果您真的需要使用背景图像来实现此目的,这里有一个示例。
当然,它并不是在所有地方都能工作——你需要 JS polyfill 来让不支持
background-size
属性的浏览器满意。我会为此推荐 jQuery Backstretch 。但是,您真正想做的(至少我希望如此)是使其尽可能灵活,因此,您应该看看 这个 或 这个 CSS 渐变教程的图像。当然,您可以使用 CSS 渐变生成器之一,例如:
If you really-really need to achieve this with background image, here is an example.
Of course it doesn't work everywhere — you need JS polyfill to make browser that don't support
background-size
property happy. I would recommend jQuery Backstretch for this.But, what you really want to do (I hope so, at least) is to make it as flexible as possible and thus, you should take a look at this or this CSS gradients tutorial instead of the image. And, of course, you can use one of the CSS gradients generator like:
我会使用页面顶部的 div 或其他元素来为您提供“栏”,并使用渐变背景图像,附加到 css 中的正文,与底部对齐并重复。
对于“栏”,使用以下 CSS 以获得相同的样式效果...
应用您的颜色并以您认为合适的方式设置酒吧的边框。
I would do it using a div or other element at the top of the page to give you the 'bar' and use a gradient background image, attached to the body in your css, aligned to the bottom and repeated.
For the 'bar', use the following CSS for the same style effect...
Apply your colours and borders to the bar however you see fit.