CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignCSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 23rd, 2004, 05:56 PM
pixeline's Avatar
pixeline pixeline is offline
King of RGB
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Location: brussels
Posts: 365 pixeline User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 23 h 35 m 18 sec
Reputation Power: 5
cohabitation problem transparent img and background color

hello mates,

for the "footer" of my webpage, i need to have the left part holding a transparent gif image (can be background image or html object, don't care as long as it shows correctly the background image of the page), and the right part to extend to the rest of the containing "footer" div, with a background-color.
But i can't make the two cohabitate peacefully. :'(
i've tried with divs, span and p, no matter what it does not work.

here is the way i first thought it would work:


Code:
<div id="footer" style="clear:both;width:100%">
     <div id="transparentImg" style="width:460px;height:22px;background:url(image.gif) no-repeat"></div>
     <div id="colorstripe" style="width:inherit;height:22px;background-color:red;text-align:right">disclaimer</div>
</div>




any idea how to make this happen ?
__________________
http://www.pixeline.be
........................................

Reply With Quote
  #2  
Old July 23rd, 2004, 08:36 PM
NotGoddess's Avatar
NotGoddess NotGoddess is offline
Kung-fu Kitty
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 350 NotGoddess User rank is Sergeant (500 - 2000 Reputation Level)NotGoddess User rank is Sergeant (500 - 2000 Reputation Level)NotGoddess User rank is Sergeant (500 - 2000 Reputation Level)NotGoddess User rank is Sergeant (500 - 2000 Reputation Level)NotGoddess User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 4 Days 6 h 9 m 2 sec
Reputation Power: 10
Send a message via AIM to NotGoddess
Re: cohabitation problem transparent img and background color.

It sounds like what you are really wanting is text that only spans the right half of your screen, correct?

I have possible solutions for you. I took out the text-align: right; as that caused extended text to break unevenly on the left, which I don't believe was your intent. These solutions work in Mozilla 0.8, IE6.0 and Opera 7

This first should provide what you need (Note: not PHP code. I just like the colors):
PHP Code:
<div id="footer" style="clear:both;width:100%">
   <
div id="colorstripe" 
    
style="float:right;width:50%;height:auto;background:red;">disclaimer3</div>
</
div


..and if you are one of those who avoid floats:
PHP Code:
<div id="footer" style="clear:both;width:100%;">
   <
div id="colorstripe"
    
style="margin-left:50%;background:red">disclaimer</div>
</
div



If you did desire the gif div for some reason:
PHP Code:
<div id="footer" style="clear:both;width:100%">
   <
div id="transparentImg"
    
style="float:left;width:49%;height:auto;"></div>
   <
div id="colorstripe"
    
style="float:right;width:50%;height:auto;background:red;">disclaimer3</div>
</
div

Note that the transparent div is 49%, not 50%...if they are both 50 it can wrap.

Reply With Quote
  #3  
Old July 24th, 2004, 05:54 AM
pixeline's Avatar
pixeline pixeline is offline
King of RGB
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Location: brussels
Posts: 365 pixeline User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 23 h 35 m 18 sec
Reputation Power: 5
thanks a lot, i'm gonna try it and get back to you i

Reply With Quote
  #4  
Old July 26th, 2004, 08:39 AM
pixeline's Avatar
pixeline pixeline is offline
King of RGB
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Location: brussels
Posts: 365 pixeline User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 23 h 35 m 18 sec
Reputation Power: 5
hello !

you can see the result here: obviously your reply guided me into a solution, where i finally had to have only one div, with a very large background image.

you can see the result here: http://temp.username.be/scanid/

there is one problem though (with firefox .9.2) : if you shrink the window horizontally, the footer comesto the middle of the page !
any idea how i can solve that ?

here is the html

PHP Code:
<div style="clear:both">&nbsp;</div>
    <
div id="footer"><div style="margin-left:50%;"Scan ID 2004 </div></div


here is the css


PHP Code:
 div#footer {
    
display:block;
    
clear:both;
    
float:left;
    
width:100%;
    
height:22px;
    
border-bottom:1px solid #78172E;
    
background:url(images/footer-left.gifno-repeat;
    
color:white;
    
text-align:right;




thanks again for your help !

Reply With Quote
  #5  
Old July 26th, 2004, 09:05 PM
NotGoddess's Avatar
NotGoddess NotGoddess is offline
Kung-fu Kitty
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 350 NotGoddess User rank is Sergeant (500 - 2000 Reputation Level)NotGoddess User rank is Sergeant (500 - 2000 Reputation Level)NotGoddess User rank is Sergeant (500 - 2000 Reputation Level)NotGoddess User rank is Sergeant (500 - 2000 Reputation Level)NotGoddess User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 4 Days 6 h 9 m 2 sec
Reputation Power: 10
Send a message via AIM to NotGoddess
Re: cohabitation problem transparent img and background color.

Quote:
Originally Posted by pixeline
there is one problem though (with firefox .9.2) : if you shrink the window horizontally, the footer comesto the middle of the page !


I looked at the page, and it's not the footer that is causing the problem, it's this line:
PHP Code:
<div id="content" style="height: 500px; margin-left: 320px;"

Change it to this and you should be fine:
PHP Code:
<div id="content" style="height: auto; margin-left: 320px;"


A couple other things. I noticed this in your CSS:
PHP Code:
 div#container {
    
background:url(...) top left no-repeat;
        
overflowhidden;


I originally thought that was the cause of the problem, before I saw the height style.
You should be careful using overflow: hidden;-especially in divs where you have content.

Also, this didn't happen when linking to your site, but when I saved the file to twiddle with it and viewed it in both Mozilla and IE6, I noticed this fading line at the top was odd. The 3rd line:
:: News :: actualité 3, en cliquant ici on accède aux news
was always visible below the first line (where the 3 lines cycled).

I didn't have time to play with that, but I might if you notice it happening as well.

Nice site, btw!

Reply With Quote
  #6  
Old July 26th, 2004, 09:21 PM
NotGoddess's Avatar
NotGoddess NotGoddess is offline
Kung-fu Kitty
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 350 NotGoddess User rank is Sergeant (500 - 2000 Reputation Level)NotGoddess User rank is Sergeant (500 - 2000 Reputation Level)NotGoddess User rank is Sergeant (500 - 2000 Reputation Level)NotGoddess User rank is Sergeant (500 - 2000 Reputation Level)NotGoddess User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 4 Days 6 h 9 m 2 sec
Reputation Power: 10
Send a message via AIM to NotGoddess
Re: cohabitation problem transparent img and background color.

Quote:
Originally Posted by pixeline
i finally had to have only one div, with a very large background image.


I didn't find the load time too large, but you could make a .gif for the left side of the footer-just take your current image, cut it off just past where the white color ends, then save it, making the dark red color transparent. Then just set the background of the footer to the color you wanted, and in the css set the new background image at a position of bottom left (or top left). That way the background color will fill in the footer for large resolutions.
That would also allow you to easily change the color scheme via CSS.

Reply With Quote
  #7  
Old July 27th, 2004, 03:51 AM
pixeline's Avatar
pixeline pixeline is offline
King of RGB
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Location: brussels
Posts: 365 pixeline User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 23 h 35 m 18 sec
Reputation Power: 5
Quote:
cut it off just past where the white color ends, then save it, making the dark red color transparent.


wow , that's a clever idea ! thanks a lot for all your help ! i'll get back to you with the final result.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignCSS Help > cohabitation problem transparent img and background color


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT