Quick Search
Sunbelthost Hosting - Colocation and Dedicated Servers

Threads: 21,763
Posts: 83,205
Members: 24,315
Newest member: joemccue

Web Hosting


 
  #1  
Old 28 Oct 2009, 05:27 AM
Sol Sol is offline
Established Member
 
Join Date: Oct 2009
Location: UK
Posts: 34
Background-color & Background-image issue

Hi,
I have a background-image at the top of a div, then i've chosen a background colour identical to the image colour so as the list inside the div expands downwards the colour will follow it.

Now my problem is that the top of this image is jaged and so the background colour apears between these jaged edges which is transparent and so i need to some how push the background colour down a few pixles so it wont show at the top.

Any ideas?

Thanks in advance.

Sol.
Reply With Quote
  #2  
Old 28 Oct 2009, 06:20 AM
JMCDesigner's Avatar
JMCDesigner JMCDesigner is offline
Established Member
 
Join Date: Aug 2009
Posts: 86
Is it available online so we can see the code and whats going on exactly?
__________________
Web Design Blackpool, UK - Sign up to my free monthly newsletter for web tips and advice
One Page Web Design
Reply With Quote
  #3  
Old 28 Oct 2009, 06:38 AM
Sol Sol is offline
Established Member
 
Join Date: Oct 2009
Location: UK
Posts: 34
i'm afraid not, it's simply and image over a coloured background, and all i need is for the top of the image to be slightly higher then the background colour.

example:

#
{
background-color: #0177C1;
background-image: url(../../pics/recent_comments.png);
border: none;
background-repeat: no-repeat;
}
Reply With Quote
  #4  
Old 28 Oct 2009, 06:55 AM
PHiL PHiL is offline
Newbie
 
Join Date: Oct 2009
Posts: 9
Cant you just just the background colour of the image from transparent to whatever colour you want to show?
Reply With Quote
  #5  
Old 28 Oct 2009, 07:01 AM
Sol Sol is offline
Established Member
 
Join Date: Oct 2009
Location: UK
Posts: 34
unfortunately the main background is not a solid colour and so i can't really do that.
Reply With Quote
  #6  
Old 28 Oct 2009, 07:08 AM
PHiL PHiL is offline
Newbie
 
Join Date: Oct 2009
Posts: 9
Sorry Im not sure what you mean, do you have a screenshot?

It sounded as if you had an image which is jaggered and the blank space is set to transparent so shows through the background colour of the webpage below, but you dont want to see this colour? Therefore what colour do you want to see instead in the jaggered space?

from your CSS the background colour is solid: background-color: #0177C1
Reply With Quote
  #7  
Old 28 Oct 2009, 07:11 AM
Sol Sol is offline
Established Member
 
Join Date: Oct 2009
Location: UK
Posts: 34
oh sorry i thought i explained it, you see i have the main background which is a repeated image. I then have a side panel and there is a div on the side that has it's own background colour but an image placed over the top of it. Now this image has a jagged top which i want to keep transparent but the background colour of this div comes through.

I think an image will be describe it, i'll get you one in a sec.
Reply With Quote
  #8  
Old 28 Oct 2009, 07:21 AM
Sol Sol is offline
Established Member
 
Join Date: Oct 2009
Location: UK
Posts: 34
Here we are:

Screen1 is with the background:


Screen2 is without the background colour and how i want it to apear:


Thanks for the help.
Reply With Quote
  #9  
Old 28 Oct 2009, 07:24 AM
PHiL PHiL is offline
Newbie
 
Join Date: Oct 2009
Posts: 9
Ah I know what you mean now, you dont want the background colour of the div to show, but the background colour (gradient) of the main page background to show through.

Think the ways to do this would be to slice the same part of the gradient where it appears on the background and make it the background of the jaggered image.

Or created a spereate div that will hold the very top part of the background image (the jaggered part) and set the background to transparent on this bit, then put the rest of the background image fading into the div colour in the div below.
Reply With Quote
  #10  
Old 28 Oct 2009, 07:27 AM
PHiL PHiL is offline
Newbie
 
Join Date: Oct 2009
Posts: 9
Edit: after seeing the image where it looks like a pattern in the background, you would be better off slicing the jaggered part of the image and putting it in its own div with a transparent bg then creating ajoining div below with a red bg.
Reply With Quote
  #11  
Old 28 Oct 2009, 09:06 AM
Sol Sol is offline
Established Member
 
Join Date: Oct 2009
Location: UK
Posts: 34
Ah that's what i thought, but didn't want to do that

Thanks for the help PHiL, i'll let you know if i can get a work around otherwise i'll be making that seperate div.

Thanks again,
Sol.
Reply With Quote
  #12  
Old 28 Oct 2009, 12:07 PM
Sol Sol is offline
Established Member
 
Join Date: Oct 2009
Location: UK
Posts: 34
Ah ha! i cheated

i removed the background color and selected the div that was inside that held the text.

I increased it's margins and set it's background colour to the colour i wanted. It's perfect now

Thanks for the help though!

Sol.
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Disappearing navigation in IE businessman2000 Web Design, HTML Reference and CSS 9 15 Dec 2009 05:00 PM
background image in a div gauri_agr Web Design, HTML Reference and CSS 2 08 Jun 2009 07:45 PM
Background image won't load unless I hit refresh? drag0n_45 Web Design, HTML Reference and CSS 9 05 Mar 2009 08:39 AM
CSS Background image rollover wINKLEr Web Design, HTML Reference and CSS 4 24 Nov 2007 08:56 PM
background image for a table BluesMatt Web Design, HTML Reference and CSS 2 21 Jul 2007 02:15 PM


All times are GMT -5. The time now is 01:23 PM.


 

Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Forums Copyright © 2004-2010, WebDevForums.com. Web design by Miami Web Design. All Rights Reserved.