Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
Background Image in centered DIV?
Old 08-02-2010, 06:20 PM Background Image in centered DIV?
Junior Talker

Posts: 2
Trades: 0
Hey guys,

I'm by no means a CSS expert, so I'm wondering if someone can help me out here. On one of my pages I've got a DIV that's been centered vertically and horizontally. Here's the code I've got for that:

Code:
#outer {
  position: absolute;
  top: 50%;
  left: 0px;
  width: 100%;
  height: 1px;
  overflow: visible;
}

#inner {
  width: 530px;
  height: 353px;
  margin-left: -265px;  /***  w / 2   ***/
  position: absolute;
  top: -176px;          /***  h / 2   ***/
  left: 50%;
}
And then my content, HTML5 video which is 530x353, is in the respective DIVs.

Now what I want to do is add a drop shadow behind my video. I figure that the best way to do this is to simply make a graphic with one and add it as a background image that is centered. I tried to set it with background-image and background-position but I couldn't get it centered. I don't even know which DIV I should be putting it in, or if I should be making a new one.
skootles is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-04-2010, 02:55 PM Re: Background Image in centered DIV?
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
Put the shadow on the div, or container, that holds the movie.
Why are you using absolute positioning?
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 08-04-2010, 06:17 PM Re: Background Image in centered DIV?
Junior Talker

Posts: 2
Trades: 0
Quote:
Originally Posted by LadynRed View Post
Put the shadow on the div, or container, that holds the movie.
Why are you using absolute positioning?
Do you mean a CSS shadow or my shadow graphic?

Also I just grabbed the code from the web.
skootles is offline
Reply With Quote
View Public Profile
 
Old 08-05-2010, 08:58 AM Re: Background Image in centered DIV?
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
Either type of shadow will work. Obviously support for CSS3 shadows isn't there yet for all browsers - most specifically IE.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Background Image in centered DIV?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.35893 seconds with 12 queries