Forum Moderators: not2easy

Message Too Old, No Replies

centering in Moz

making a centered link in both ie/Moz

         

hafnius

3:54 pm on Jul 19, 2003 (gmt 0)

10+ Year Member



Hi all

I have little IMG on the bottom of my page that links to the top, like this:

<a href="#top"><img src="/images/up.gif" alt="Top" width="13" height="7" /></a>

the prob is, i can center it fine in IE with a class and text-align:center; this doesnt work in moz.

Nothing seems to be able to get this image centered in moz. id, classes, wrapping it in P or DIV. What to do?

Any suggestions welcome - i could be missing the obviuos!

Regards
Hafnius

DrDoc

3:56 pm on Jul 19, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you put the link in a paragraph, and set text-align:center it should work.

If not, then there's something wrong with the HTML/CSS code... a missing semi-colon perhaps?

Jocke

4:08 pm on Jul 19, 2003 (gmt 0)

10+ Year Member



Try this:

<a href="#top"><img src="/images/up.gif" alt="Top" width="13" height="7" style="margin-left:auto; margin-right:auto;" /></a>

hafnius

7:29 pm on Jul 19, 2003 (gmt 0)

10+ Year Member



Hi DrDoc and Jocke

I solved it by wrapping it in a P an setting it to text-align:center;

The thing that made MOZ ignore this was that all my IMG are set to display:block; so when i turned it inline it worked out right.

Thank you both

Kind regards
Hafnius

moltar

9:09 pm on Jul 19, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



just use the plain, old <center> tag. no need to get all fancy :)

hafnius

11:21 pm on Jul 19, 2003 (gmt 0)

10+ Year Member



Hi Moltar

just use the plain, old <center> tag. no need to get all fancy :)

Youre right, that would have solved it, but it wouldnt be the right way. IMHO if it can be done with css it should be done with css. Besides the site i am making is xhtml strict and the center element is deprecated in html 4.0

I dont want to sound to religious, but i want to do it the "right way" even though it takes some extra time.

I apprecciate your idea, but i hope you can see my point.

Kind Regards
Hafnius

moltar

6:04 pm on Jul 20, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



That is very true hafnius. I try to make sites that validate as well.

I am not that "crazy" about CSS though. I use it a lot, but sometimes I just stick with old tags, if it validates.

<center> tag validates fine in XHTML 1.0 Transitional.

I am just always too cautious about CSS, some browsers just don't "get" specific CSS techniques.