- This topic is empty.
Viewing 7 posts - 1 through 7 (of 7 total)
Viewing 7 posts - 1 through 7 (of 7 total)
- The forum ‘CSS’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
this might be a stupid question, but how can I center a photo in a div without using margins?
Is there a rule for other elements like the ‘text-align’ rule?
Thanks
you can use relative positioning or the "margin: 0 auto" trick
Thanks, though I tried this and it didn’t work.
I tried it with all positioning:relative and absolute
That may be the problem. Try "position: relative" instead of "positioning:relative".
I normally have this is my reset stylesheet for generic classes i want to use wsuch as img_center
You can also use "text-align: center;"
I was using ‘position’ not ‘positioning’. I just used the word positioning in the post.
I need to center horizontally, though not vertically.
This looks like it will center both ways.