Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > CSS > CSS Cascading Style Sheets
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old August 4th, 2013, 11:28 PM
Registered User
Points: 5, Level: 1
Points: 5, Level: 1 Points: 5, Level: 1 Points: 5, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2013
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Div background doesn't show

Pretty common problem, judging from what i've been seeing so far. Most of the time it's url problem or backslashes etc. Not this time though...

My code
Code:
<div id="est"></div>
Code:
#est {
	margin-left:55px;
    margin-top:55px;
	background-image: url(http://blabla.com/wp-content/themes/blankslate.3.3/blankslate/images/est.jpg);
	background-repeat: no-repeat;
	}
I've been trying everything. Local url/full url, quotation marks (single and double), bacground-imgage:/background. No luck...
Thanks in advance!
Reply With Quote
  #2 (permalink)  
Old February 3rd, 2015, 02:34 PM
Registered User
Points: 6, Level: 1
Points: 6, Level: 1 Points: 6, Level: 1 Points: 6, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Feb 2015
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

An <img> placed inside a container like your div has dimensions that will "stretch" that container around it by default. That's because the item is something that fits into that container.

Styling a background image falls outside of the document content and merely "paints" it into what you specify. If that div you want a background on has no content in it and has no defined area then nothing will show. Set your #est div width and height or place content into it to "stretch it" and you will see your background displays as you intend.

e.g.
#est {
margin-left:55px;
margin-top:55px;
width: 300px;
height:100px;
background-image: url(http://blabla.com/wp-content/themes/...ages/est.jpg);
background-repeat: no-repeat;
}
Reply With Quote
Reply


Thread Tools
Display Modes

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
DIV CSS background-image does not display StevenF ASP.NET 3.5 Basics 7 February 2nd, 2010 05:22 PM
Background image in DIV not displaying creative_eye CSS Cascading Style Sheets 3 December 31st, 2009 03:05 PM
Help need fixed background on a scrollable div birthdayzoot CSS Cascading Style Sheets 3 June 20th, 2007 02:15 PM
Background Image problem in DIV tag. cumminsj CSS Cascading Style Sheets 6 September 15th, 2006 03:02 AM
background image for <div> anshul CSS Cascading Style Sheets 4 May 16th, 2005 11:00 AM



All times are GMT -4. The time now is 07:41 AM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.