image positioning using css

Reply

Join Date: May 2005
Posts: 215
Reputation: shanenin is an unknown quantity at this point 
Solved Threads: 16
shanenin shanenin is offline Offline
Posting Whiz in Training

image positioning using css

 
0
  #1
Feb 24th, 2008
I am trying to position my logo at the very top and center of my web site. I am able to get it centered from left to right. The problem is I have about a several pixel space between the top of the image and the top of the web page. I would like to close up this space. I think the problem is to do with a margin around the image. I have tried several margin properties(margin-top: 0;) with out any luck. Below is what I am using. Thanks for any suggestions.
HTML and CSS Syntax (Toggle Plain Text)
  1. img.head {
  2. display: block;
  3. margin-left: auto;
  4. margin-right: auto;}
Last edited by shanenin; Feb 24th, 2008 at 3:58 pm.
In a perfect world exceptions would not be needed.
Reply With Quote Quick reply to this message  
Join Date: May 2005
Posts: 215
Reputation: shanenin is an unknown quantity at this point 
Solved Threads: 16
shanenin shanenin is offline Offline
Posting Whiz in Training

Re: image positioning using css

 
0
  #2
Feb 24th, 2008
Why doesn't the following seem to make any difference? You would think that would get rid of the margin above the image.
HTML and CSS Syntax (Toggle Plain Text)
  1. margin-top: 0
In a perfect world exceptions would not be needed.
Reply With Quote Quick reply to this message  
Join Date: May 2005
Posts: 215
Reputation: shanenin is an unknown quantity at this point 
Solved Threads: 16
shanenin shanenin is offline Offline
Posting Whiz in Training

Re: image positioning using css

 
0
  #3
Feb 24th, 2008
If I set margin: 0 as a body attribute it fixed it.
In a perfect world exceptions would not be needed.
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 483
Reputation: DangerDev has a spectacular aura about DangerDev has a spectacular aura about 
Solved Threads: 58
DangerDev's Avatar
DangerDev DangerDev is offline Offline
Posting Pro in Training

Re: image positioning using css

 
0
  #4
Feb 25th, 2008
there may be padding or margin in container element,
just post the css of container of image.
if no container then post css of body.
Freedom in the Mind, Faith in the words.. Pride in our Souls...
Indian Developer
http://falaque.wordpress.com/
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the HTML and CSS Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC