Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

seamless website header

Featured Replies

Hello people,

 

I am trying to create a website header using dreamweaver cs5 and css like the one at www.bottlerocketcreative.com.

 

I have tried placing 2 background images using css for the black banner set to repeat-x and the bg texture set to repeat (x and y). I have also tried to make an image which contains a banner and the logo in the centre and then placed a wrapper div around the centred div, which has just the black texture.

 

Both of these didn't work :(

 

Does anyone know an effective way to do this??

 

Any help would be much appreciated.

 

Thanks in Advance

 

Ajit

If you want two background images you can place one in the html style and the other in the body style. Put the repeating x image in html

html { background: url(image1.jpg) repeat-x; }
body { background: url(image2.jpg) top center fixed no-repeat; }

 

Or you can put one in the body style and the other in a page wrapper div.

 

Does that help?

 

Edit. You had two options in your post but you can use the same principle.

For the first, the html background would have the "repeat" style to repeat both x and y (or just don't state repeat as it's the default) and the body style would have the repeat-x.

Edited by Wickham

OK, I missed that. So if the OP is using an image like that (1200*1550) he could put the textured background-image in the html style to repeat over the whole page and the image in the body style with fixed top center no-repeat and then the html texture would fill in at the sides when the resolution is over 1200px wide.

 

If it's just a black background-color that's wanted around the image, then it can all be done in the same tag:-

body { background: #000000 url(image.jpg) top center no-repeat fixed; }

 

I have also tried to make an image which contains a banner and the logo in the centre and then placed a wrapper div around the centred div, which has just the black texture.

html { background: url(texture.jpg); }
body { background: url(banner.jpg) top center fixed no-repeat; }
#wrapper { background: url(logo.jpg) top center fixed no-repeat; }

Edited by Wickham

There is also a very common issue happens mostly if you give your main wrappers postion: absolute or relative, the background image in body gets disappear. I have seen many people stuck with it. in such situation giving height or min-height to body solves the problem

  • Author

Hi everyone,

 

Thanks for your replies i really appreciate your help.

 

I have made an image similar to the 1200 x 1550 and places this in the body tag as top center fixed no repeat and places the image in the html tag as repeat-x but there is a gap between the tiled images?

 

Is there a way to get rid of that?

i tried, margin:0; and border:0;, both didn't work.

 

I am assuming div tags or tables would have to centred relative to the browser.

 

Thanks

 

Ajit

Edited by asp24

If there is a gap between the repeating bits of a background-image, you should take a close look at the image, because the space may be around the edge.

  • Author

Hi again,

 

Ignore the last comment got it working now!!

 

Thanks

 

So much for your help :)

 

Ajit

  • Author

If there is a gap between the repeating bits of a background-image, you should take a close look at the image, because the space may be around the edge.

 

That was exactly it wickham, thanks again.

OK, I missed that. So if the OP is using an image like that (1200*1550) he could put the textured background-image in the html style to repeat over the whole page and the image in the body style with fixed top center no-repeat and then the html texture would fill in at the sides when the resolution is over 1200px wide.

 

If it's just a black background-color that's wanted around the image, then it can all be done in the same tag:-

body { background: #000000 url(image.jpg) top center no-repeat fixed; }

 

 

html { background: url(texture.jpg); }
body { background: url(banner.jpg) top center fixed no-repeat; }
#wrapper { background: url(logo.jpg) top center fixed no-repeat; }

 

 

lol no worries, just thought id point it out. Thats the first thing i look at when it comes to bg image issues lol :)

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.