2 replies [Last post]
erat
Offline
newbie
Last seen: 10 years 28 weeks ago
Timezone: GMT+3
Joined: 2005-02-24
Posts: 8
Points: 2

blaa
blaa blaa

blaa2
blaa blaa 2

blaa 3
blaa blaa 3

I want to position class submit_button relative to class guestbook, but not relative to class message_header or class message. The container div is centered so absolute positioning wouldn't work I guess.

The message divs are php-generated and their height and amount changes per entries so I can't position the submit button relative to messages, if I want it to stay at an exact place.

Previous example is a pseudo-page, the actual page is sliced into dozens of cells of different widths and heights. Tables because I want some things to line up pixelwise exactly without doing loads of hacks and redirections to different pages for users using different versions of different browsers.

-eRat

Edit: What I've understood from several layout positioning tutorials and explanations, absolute positioning should position relative to parent(container div). However in this case it positions relative to browser window.

wolfcry911
wolfcry911's picture
Offline
Guru
MA, USA
Last seen: 6 years 39 weeks ago
MA, USA
Timezone: GMT-5
Joined: 2004-09-01
Posts: 3224
Points: 237

It will position relative to

It will position relative to the parent if the parent (or ancestor) has a positioning context. Add position: relative; to the parent to accomplish this. But I must ask, where do you want the submit button? Could you not just use margins and padding to place it? And I'd bet you could do this without the table...

erat
Offline
newbie
Last seen: 10 years 28 weeks ago
Timezone: GMT+3
Joined: 2005-02-24
Posts: 8
Points: 2

Aah, thank you, works

Aah, thank you, works perfectly.

Positioning the submit button would be easy with css only I assume. When I asked here earlier if it would be easy to position css graphics page exactly pixelwise I got answer 'It's not doable or you would go insane trying.'

The page I'm doing is more like graphical show-off page than an info page where thousands of ppl dl it daily. A game clan web page. But I still want to keep dl times reasonable by tiling as much as possible and reducing jpg quality. Plus I don't want to use flash and want to use as little javascript as possible. I will have a different page for lynx/handheld users.

-eRat

p.s. If you really want to see it at it's current uploaded state: http://clanfrp.byethost13.com/cms there it is. You probably hate it for all the non-informative gfx(much of it is insider stuff) and unscalability, but this heavy look is the way I like my pages. It's still 350kilobytes or so and I'm aiming for <200.

p.p.s. Thanks again Smile