|
|
 |
| CSS Cascading Style Sheets All issues relating to Cascading Style Sheets (CSS). |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the CSS Cascading Style Sheets section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.
|
 |

October 30th, 2009, 01:48 AM
|
|
Authorized User
|
|
Join Date: Jan 2004
Location: , , .
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Background image in DIV not displaying
I've a image which I need to show as background in a DIV. Here is the code:
CSS:
#inner_banner { background:url(images/inner-banner.jpg) no-repat; height:200px; display:block; width:950px; float:left; }
HTML:
<div id="inner_banner">some text here</div>
But this code doesn't showing the background image (in all browsers), only blank space. What I'm doing wrong?
|

October 30th, 2009, 08:38 AM
|
|
Friend of Wrox
|
|
Join Date: May 2004
Location: India
Posts: 563
Thanks: 0
Thanked 14 Times in 14 Posts
|
|
Change:
Code:
<div id="inner_banner">some text here</div>
to
Code:
<div class="inner_banner">some text here</div>
Please check this link for more example:
http://www.hscripts.com/tutorials/css/backp4.php
__________________
Om Prakash Pant
|

October 30th, 2009, 10:04 AM
|
 |
Wrox Author
Points: 33,554, Level: 80 |
|
|
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 10,228
Thanks: 7
Thanked 203 Times in 201 Posts
|
|
Hi om_prakash,
I don't see how that would fix the problem. Take a look at the selector:
#inner_banner
It's an ID selector and thus you need the id=, not class=
The problem is with the no-repat. Change that to no-repeat and it should work...
Cheers,
Imar
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |