TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 07-21-2009, 08:13 AM   #1 (permalink)
Super Moderator
Inquisitive 
 
codefreek's Avatar
 
Join Date: Sep 2007
Location: Near you.
Posts: 791
Thanks: 241
codefreek is on a distinguished road
Application Error small Css problem - Thank you in advance..

css Code:
#ImgHolder{width:840px; height:250px; background:url(images/image1.jpg) 0 100% no-repeat; background-position:center; padding:29px 0 0; margin:0 0 40px 0;}
Why when i "background-position:center;".. It, Wont Center.
The Image,

Thank you.

-Cf
codefreek is offline  
Reply With Quote
Old 07-21-2009, 09:01 AM   #2 (permalink)
The Acquainted
 
Hightower's Avatar
 
Join Date: May 2009
Location: Durham, UK
Posts: 134
Thanks: 9
Hightower is on a distinguished road
Default

I'm not the most fluent with CSS, but could it be this:

background:url(images/image1.jpg) 0 100% no-repeat; (the 100% bit)

Like I say, this is just a stab in the dark.
__________________
Hightower's Softpolio
Send a message via MSN to Hightower
Hightower is offline  
Reply With Quote
The Following User Says Thank You to Hightower For This Useful Post:
codefreek (07-21-2009)
Old 07-21-2009, 09:16 AM   #3 (permalink)
Super Moderator
Inquisitive 
 
codefreek's Avatar
 
Join Date: Sep 2007
Location: Near you.
Posts: 791
Thanks: 241
codefreek is on a distinguished road
Default

not it.. sorry but thanks for comment and trying to help,
much appreciated.

-Cf
codefreek is offline  
Reply With Quote
Old 07-21-2009, 02:32 PM   #4 (permalink)
The Addict
 
tony's Avatar
 
Join Date: Aug 2008
Posts: 295
Thanks: 8
tony is on a distinguished road
Default

have you try using 2 keywords:
Code:
background-position:top center;
If that doesn't work, it's because the center keyword doesn't work right in most browsers (that's my personal experience). I always use the percentages:

Code:
/*                  y x  */
background-position:0 50%;
you just need to calibrate the 50% percentage so it can be in the center
tony is offline  
Reply With Quote
The Following User Says Thank You to tony For This Useful Post:
codefreek (07-21-2009)
Old 07-22-2009, 03:33 PM   #5 (permalink)
Super Moderator
Inquisitive 
 
codefreek's Avatar
 
Join Date: Sep 2007
Location: Near you.
Posts: 791
Thanks: 241
codefreek is on a distinguished road
Default

css Code:
#offset{width:384px; float:left; padding:0 0 0 202px;}
#IMGholder{width:840px; height:250px; background:url(images/image1.jpg) 0 100% no-repeat; padding:29px 0 0; margin:0 0 40px 0;}
so i solved it by turning the 202px part to 202px..
Quote:
#offset{ 202px;}
codefreek is offline  
Reply With Quote
Old 08-19-2009, 07:05 PM   #6 (permalink)
The Wanderer
 
Join Date: Aug 2009
Posts: 17
Thanks: 0
Rhinos is on a distinguished road
Default

It should be:

Code:
#ImgHolder {
  width: 840px;
  height: 250px;
  background: url(images/image1.jpg) no-repeat 50% 50%;
  padding: 29px 0 0;
  margin: 0 0 40px 0;
}
Now I don't know what your paddings and margins do but the 50% 50% is what puts it in the center of the 'box'.

You can try it here on W3CSchools by changing the background-position values and clicking the 'Edit and Click Me >>' button to see the changes.
Rhinos is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

vB 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
problem getting data on the html table.... jetnet1 General 2 11-24-2008 06:55 PM
Huge Session Problem Killswitch General 1 11-17-2008 02:36 AM
Small php error! - Thank you in advance! codefreek Absolute Beginners 1 10-21-2008 08:22 PM
Small php error - Thank you in advance! codefreek Advanced PHP Programming 44 10-19-2008 07:12 PM
a small css problem. codefreek XHTML, HTML, CSS 5 01-03-2008 05:57 PM


All times are GMT. The time now is 07:18 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design