|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Greetings,
I posted this question in the HTML forum, too, but I realize that maybe the answer to this question would better be provided by CSS2, rather than using HTML tables, as the latter may be deprecated in the future--it seems--as a layout tool. I used to be able to position an image, or anything basically, in a table cell that is in the "absolute middle" of a web page, i.e. centered horizontally and vertically, using Dreamweaver MX. But, for some weird reason, I cannot do it anymore using Dreamweaver MX 2004. No matter what I try, the image or contents of the cell or table are always at the top of the page, centered horizontally, yes, but not vertically. I tried nesting a table within a table, and I tried using a percentage-based 3x3 table, but nothing works. I noticed that the "height" attribute of a table is deprecated now, thus, you should not give a table a "height" of 100%. Is that the reason? And if so, then what is another way to do this now? I mean putting an image or so in the absolute middle or center of a page? Better yet... What I really want to do is to place an image in the vertical center of a page, yet a bit to the side, but within proportion to the page of the visitor. Meaning, I'd like the center of the image, for example, to always have 50% of the page over it and 50% below it, exactly; and I'd like it to have 33% of the page to its right side, for instance, and 66% to its left side, always, regardless to the visitor's resolution. Now how can I do this, especially using Dreamweaver MX 2004? Thanks for anyone taking the time to help. I'll try to attach an image to demonstrate what I mean visually. http://forums.devshed.com/attachmen...tachmentid=4599 |
|
#2
|
||||
|
||||
|
Background image or real image?
__________________
# Jeremy Explain your problem instead of asking how to do what you decided was the solution. |
|
#3
|
|||
|
|||
|
I meant a real image. Not only an image to be accurate, but an image and some text beside it and so. I just want maybe a couple of objects, or a little more, to be place in the vertical center, and the point between the right 33% and left 66% of the horizontal line of the page. Thanks.
P.S. I didn't mean to cross-post really, I'd like to know the answer in HTML and in CSS2, at the same time. Because maybe CSS2 will be hard for me to understand, so I can still go for the table layout using HTML until I get a good grasp of CSS. Sorry to not point that out in both forums. |
|
#4
|
||||
|
||||
|
Code:
<img style="position: absolute; left: 66%; top: Y%; margin-left: -Xpx;" src="foo.png" /> Even if you want an answer in two different ways, still don't cross-post. What we end up with is two conversations about the same thing. Even in the HTML forum you would probably receive a CSS solution and possibly vice-versa. |
|
#5
|
|||
|
|||
|
Hey, that worked perfectly. And I figured out how to do it with a small table nested within another table, even. I could even adjust the numbers and put it anywhere I like. That's better than I could've dreamt of, and I couldn't believe how easy it is and how simple its code is. Thank you very much, jharnois. I really appreciate it.
|
![]() |
| Viewing: Dev Shed Forums > Web Design > CSS Help > Absolute middle & other positions using CSS2 |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|