[SOLVED] div background image problem in ie

This is a discussion on "[SOLVED] div background image problem in ie" within the Web Page Design section. This forum, and the thread "[SOLVED] div background image problem in ie are both part of the Design Your Website category.



Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Nov 29th, 2007, 13:54
New Member
Join Date: Nov 2007
Location: UK
Age: 27
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
[SOLVED] div background image problem in ie

Hi everyone,

I suspect this is something really easy that i have just overlooked but i have a problem displaying a background-image in ie. The image is a drop shadow and has a width of 934px and height of 8px.

This is what it is supposed to look like, and is in FF.



and this is what it looks like in IE.



here is the code. I did have it as 1px width and repeated it but the same problem occured. It is now one image, but the problem remains

Code: Select all
#shadow { width: 934px; height: 8px; background-image: url(dropShadow.jpg); background-repeat: no; }
Code: Select all
<div id="headerSurround">
            <!--search bar here -->
</div>
<div id="shadow"></div>
Thanks
Reply With Quote

  #2 (permalink)  
Old Nov 29th, 2007, 14:02
welshstew's Avatar
Lead Administrator

SuperMember
Join Date: May 2007
Location: inside the outside
Posts: 1,388
Blog Entries: 13
Thanks: 1
Thanked 16 Times in 14 Posts
Re: div background image problem in ie

first you need to change
background-repeat: no;

to

background-repeat: no-repeat;

can you post a link so that I can have a look at the rest of the code
__________________
WelshStew
Lead Administrator

tierney rides tboard - uk site | xtreme wales - extreme clothing
If you think I've helped, click the "Thanks"
webforumz - facebook | LinkedIn
Last Blog Entry: Web Standards Curriculum Launched (Jul 8th, 2008)
Reply With Quote
  #3 (permalink)  
Old Nov 29th, 2007, 15:05
New Member
Join Date: Nov 2007
Location: UK
Age: 27
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Re: div background image problem in ie

Code: Select all
<!-- START header -->
<div id="headerTopBorder"></div>
<div id="headerSurround">
   <!--search bar here -->
</div>
<div id="shadow"></div>
<div id="headerContent">
    <!-- content for header in here -->
</div>
<div class="topNav">
    <ul>
        <li><a href=""></a></li><li><a href=""></a></li><li><a href=""></a></li><li><a href=""></a></li><li><a href=""></a></li><li><a href=""></a></li>
      </ul>
</div>
<!-- END header -->
Code: Select all
/*START headers*/
#headerTopBorder { width: 934px; height: 10px; background-color: #fec480; }
#shadow { width: 934px; height: 8px; background-image: url(dropShadow.jpg); background-repeat: no-repeat; }
#headerSurround { width: 934px; height: 50px; background-color: #fc8801; }
#headerContent { width: 934px; height: 223px; background-image: url(headerContent.jpg); }
.topNav { width: 934px; height: 25px; background-color: #fc8801; }
.topNav a:hover { background-image: url(navHover.jpg); }
.topNav a { float: left; height: 25px; display: block; padding-left: 10px; padding-right: 10px; border-right: 1px solid #f2982f; line-height: 1.5em; }
/*END headers*/
Now i changed that mistake to no-repeat i just get a white space below in IE, like this

Reply With Quote
  #4 (permalink)  
Old Nov 29th, 2007, 15:41
New Member
Join Date: Nov 2007
Location: UK
Age: 27
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Re: div background image problem in ie

I've fixed it now...it was to do with my doctype being wrong. Thanks for the quick response.
Reply With Quote
  #5 (permalink)  
Old Nov 29th, 2007, 16:02
karinne's Avatar
SuperMember

SuperMember
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: [SOLVED] div background image problem in ie

Ah well ... something we would not have been able to discern

Next time, it would be best to post a link so we can see ALL the code.
Reply With Quote
  #6 (permalink)  
Old Nov 29th, 2007, 16:08
New Member
Join Date: Nov 2007
Location: UK
Age: 27
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Re: [SOLVED] div background image problem in ie

Quote:
Originally Posted by karinne View Post
Ah well ... something we would not have been able to discern

Next time, it would be best to post a link so we can see ALL the code.
Yeah sorry, i don't have a host atm. Sorry if i wasted anyones time. Thanks for your help anyway.
Reply With Quote
  #7 (permalink)  
Old Nov 30th, 2007, 08:52
AdRock's Avatar
SuperMember

SuperMember
Join Date: Jul 2006
Location: Devon, England
Posts: 565
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to AdRock
Re: [SOLVED] div background image problem in ie

I changed the doctype becuase it was incomplete and it works in IE7 but not in IE6
Reply With Quote
  #8 (permalink)  
Old Nov 30th, 2007, 09:30
New Member
Join Date: Nov 2007
Location: Bangalore
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Re: [SOLVED] div background image problem in ie

Quote:
Originally Posted by AdRock View Post
I changed the doctype becuase it was incomplete and it works in IE7 but not in IE6
"doctype" is very important because browsers decide whether to use "standards" mode of rendering or "quirks" mode basedo n the doctype.

I have a writing called "the making of a webdev" series of blog posts. yesterday's topic was just that -- on "doctypes". You may follow it up there -- http://thanix.info/blog
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
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Background image not showing Aso Web Page Design 1 Apr 22nd, 2008 15:54
[SOLVED] image background dab42pat Graphics and 3D 4 Jan 7th, 2008 03:50
[SOLVED] Background Image Help RZX Developer Web Page Design 4 Dec 12th, 2007 09:39
[SOLVED] Fixed Background Image? Jack Franklin Web Page Design 4 Oct 7th, 2007 19:45
Problem with my footer background image in IE dthomas31uk Web Page Design 3 Jul 1st, 2007 12:49


All times are GMT. The time now is 19:26.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43