Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Problem centering background image


  • Please log in to reply
5 replies to this topic

#1 Guest_Daghead_*

Guest_Daghead_*

  • Guests
  • OFFLINE
  •  

Posted 31 January 2010 - 05:43 PM

I want to stick a small image in the horizontal and vertical center of a page to serve in my home tab. I'm totally new at this and am not even sure whether I implemented this recommended CSS correctly. This is what the page's source code gets me in Firefox, even though it works perfectly when I switch to IE. Compiled in Programmer's notepad.

Thanks for any help!
Dave

BC AdBot (Login to Remove)

 


#2 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD

Posted 31 January 2010 - 07:49 PM

In general, in order to center an element, the CSS way to do it is:
style="alignment-left:auto; alignment-right:auto:"


#3 Guest_Daghead_*

Guest_Daghead_*

  • Guests
  • OFFLINE
  •  

Posted 31 January 2010 - 08:03 PM

Yeah see, I don't even know for sure where to put that, how to associate that with the image...

#4 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:08:41 PM

Posted 31 January 2010 - 08:28 PM

Do you have an image tag that displays the background image?

#5 Guest_Daghead_*

Guest_Daghead_*

  • Guests
  • OFFLINE
  •  

Posted 31 January 2010 - 09:02 PM

I don't even know what that means. I guess I should be ashamed for not doing due research, and in the end expecting someone else to do the work for me, sorry.

#6 Romeo29

Romeo29

    Learning To Bleep


  • Members
  • 3,194 posts
  • OFFLINE
  •  
  • Gender:Not Telling
  • Location:127.0.0.1

Posted 02 February 2010 - 10:31 PM

"file:///C:/Users.....Firefox.png"
This path may work when viewing web page on your own computer but wont work if you upload it to a web server. So better get in the habit of using relative paths.

Something like this should work between <head> and </head> :
<style>
	   body{background:url('Firefox.png') no-repeat fixed center;}
</style>





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users