943,589 Members | Top Members by Rank

Ad:
Feb 24th, 2008
0

image positioning using css

Expand Post »
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.
Similar Threads
Reputation Points: 10
Solved Threads: 17
Posting Whiz in Training
shanenin is offline Offline
217 posts
since May 2005
Feb 24th, 2008
0

Re: image positioning using css

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
Reputation Points: 10
Solved Threads: 17
Posting Whiz in Training
shanenin is offline Offline
217 posts
since May 2005
Feb 24th, 2008
0

Re: image positioning using css

If I set margin: 0 as a body attribute it fixed it.
Reputation Points: 10
Solved Threads: 17
Posting Whiz in Training
shanenin is offline Offline
217 posts
since May 2005
Feb 25th, 2008
0

Re: image positioning using css

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.
Reputation Points: 165
Solved Threads: 59
Posting Pro in Training
DangerDev is offline Offline
485 posts
since Jan 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in HTML and CSS Forum Timeline: css code that is suppose to only work in IE Well this makes it work in Ie,ff,opera
Next Thread in HTML and CSS Forum Timeline: Layout Problems





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC