This is a discussion on "[SOLVED] Problems with centering in CSS." within the Web Page Design section. This forum, and the thread "[SOLVED] Problems with centering in CSS. are both part of the Design Your Website category.
|
|
|
|
|
![]() |
||
[SOLVED] Problems with centering in CSS.
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
||||
|
[SOLVED] Problems with centering in CSS.
Okay, I have tried everything people. lol... It's starting to get agrivating, lol...
For css I have tried,
Any help?
Last Blog Entry: My blog? (Oct 18th, 2007)
|
|
|
|
|||
|
Re: Problems with centering in CSS.
Can't help you since you did not include your HTML code, and you did not specify your question clearly..
Try posting the complete file (HTML, CSS, whatsoever..) and you will get a much more quick response.. P/S: Do you know the magic word margin: 0 auto;?
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)
|
|
||||
|
Re: Problems with centering in CSS.
The one with <center></center> is my html code for it. i tried it with the css version but them used the <center> tags as that's the only thing that worked. And no I'm not sure what u mean my the magic word...
Last Blog Entry: My blog? (Oct 18th, 2007)
|
|
|||
|
Re: Problems with centering in CSS.
All you need to si is to put your image inside a div and set the div margin reffer to the magic word
Something like this:
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)
|
|
||||
|
Re: Problems with centering in CSS.
it's weird. that do'nt even work.
here's the page it's on.l http://newbreedjesusfreaks.com/index.php?page=rules
Last Blog Entry: My blog? (Oct 18th, 2007)
|
|
|||
|
Re: Problems with centering in CSS.
it basically center the #image div, not the image inside it..
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)
|
|
||||
|
Re: Problems with centering in CSS.
what? if that's the case why wouldll the image even center?
Last Blog Entry: My blog? (Oct 18th, 2007)
|
|
|||
|
Re: Problems with centering in CSS.
In that case, set the #image div width and height to the size of your image. If you don't specify them, the #image div will expand into it's parent div size.. that would be your #content3 div.. there you go..
Now you know what is the magic word huh?
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)
Last edited by Monie; Oct 30th, 2007 at 06:14. |
|
|||
|
Re: Problems with centering in CSS.
This comes up again and again.
<img>s are inline elements. To centre something, it must be formatted as a block-level element. You can either put a <div> (these are block-level) around it as monie suggested, and centre the <div>; or you can use the CSS:
I looked at your CSS, and I could not find any style rules relating to #image. I did find a lot of absolute positioning, however, which will cause you problems because, frankly, you don't have the skill to use it. The Lord moves in mysterious ways! |
|
|||
|
Re: Problems with centering in CSS.
What a funny reply there Mike..
I did not know myself about the display: block; until you mention it! Thanks Mike, I learn something new today. My solution will also work but not effective enough. The real solution is what you have posted. Thanks.. Now we have another magic word for today: { display: block; }
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)
|
|
|||
|
Re: Problems with centering in CSS.
Quote:
Since <img> is an inline element, and remains an inline element no matter how we change the formatting rules, you will get validation errors when the <img> is a direct child of the <body> -- because every inline element must have some block-level ancestor. Of course, you can also fix all such errors forever by using a wrapper <div>, and most sites have several wrapper <div>s anyway. |
|
|||
|
Re: Problems with centering in CSS.
OIC... Thats another knowledge I get from you
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)
|
|
||||
|
Re: Problems with centering in CSS.
LOL, you guys are too funny, lol... (I think that's why I like this site so much, lol.)
Last Blog Entry: My blog? (Oct 18th, 2007)
|
|
||||
|
Re: Problems with centering in CSS.
Have you got this sorted yet?
|
|
||||
|
Re: Problems with centering in CSS.
I'm not at home so I cannot do anythig yet. I am waiting for my mom to come get me. lol...
Last Blog Entry: My blog? (Oct 18th, 2007)
|
|
|||
|
Re: Problems with centering in CSS.
I have tried both way, and conformed it is working...
Now its up to you to test them..
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)
|
|
||||
|
Re: Problems with centering in CSS.
Okay,
So for the CSS if i put
Last Blog Entry: My blog? (Oct 18th, 2007)
|
|
|||
|
Re: Problems with centering in CSS.
Wrong..!
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)
|
|
||||
|
Re: Problems with centering in CSS.
this?
Last Blog Entry: My blog? (Oct 18th, 2007)
|
![]() |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [SOLVED] Centering Vertically | R8515198 | Web Page Design | 5 | Dec 6th, 2007 11:05 |
| [SOLVED] page centering issues | VanderBOOM | Web Page Design | 12 | Dec 4th, 2007 15:06 |
| [SOLVED] Centering horizontally and vertically | Emzi | Web Page Design | 4 | Nov 1st, 2007 16:07 |
| [SOLVED] Centering! | mcdanielnc89 | Web Page Design | 20 | Oct 21st, 2007 22:02 |
| Tip : Vertical and Horizontal Centering - Solved! | gwx03 | Web Page Design | 0 | Dec 15th, 2003 06:11 |