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.

CSS backgrounds

Featured Replies

im trying 2 get a background to work for a info bar at the top of my site

 

.infoBar{

width: 100%;

height: 20px;

background-color: #CC0000;

background-image: url(images/infoback.jpg);

background-repeat: repeat-x;

border-bottom: 1px solid #FF4040;

outline: 1px solid #CC0000;

 

^Have tryed a lot of ways of doing it but still not work :(

Cant any one help and im i being a right noob lol

 

Thanks

a bit difficult to say in isolation. does the image exist?

try in notepad++.

for me it doesn't work in windows notepad.

Your style above needs closing with }

Was that just a typo here or did you forget it in your stylesheet?

zed yes m8 the image is in the right place thanks

 

ryukcro im using Notepad++ thanks

 

just recreated your code and it works for me, know this is obvious but you are using <div class=" not trying to insult your intelligence, its just a mistake I have made in the past :)

  • Author

no still having the same problem cant seem 2 get it 2 work :( and my head is killing dont no if thats from looking at the same pc of code or from going out last night but it is killing lol

have you got a link to the actual page?

okay, I asked about the image existing but is it where the css is expecting it to be?

im trying 2 get a background to work for a info bar at the top of my site

 

.infoBar{

width: 100%;

height: 20px;

background-color: #CC0000;

background-image: url(images/infoback.jpg);

background-repeat: repeat-x;

border-bottom: 1px solid #FF4040;

outline: 1px solid #CC0000;

 

^Have tryed a lot of ways of doing it but still not work :(

Cant any one help and im i being a right noob lol

 

Thanks

 

Yeah, it's kinda hard for us to help more speicifically if we can't see what you've got in context.

 

Feel free to PM me so you can email your page over so I can have a look for you. I've found that stuff that drives people nuts normally sticks out like a sore thumb to the next person to look at it!

can you post up the HTML that accompanies this please, and the image if possible.

 

First:

 

•Make Sure you have closed all tags corrctly

•Make sure the div is the same height as the image

 

ALSO - when testing on a local server, it assumes all your images have lowercase extensions, so make sure that you file is infoback.jpg not infoback.JPG. To view this open up where the file is saved and in Win7 go organise>Folder and search options>view>Hide extensions for known file types, make sure this is unchecked. In vista and XP, its simply tools>options>view>Hide extensions for known file types

 

Let me know if this works for you :)

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.