7 replies [Last post]
spooksie
Offline
newbie
Manchester
Last seen: 15 years 11 weeks ago
Manchester
Joined: 2005-09-20
Posts: 4
Points: 0

Hi

i'm having a problem at the moment on CSS2 positioning. Basically I need to put a floating banner to the right of a table. One of the problems is that the <table> is aligned=Center.

I've managed to get it right, but once I change resolutions it doesn't work. Does anyone know any way of making it stick to the right of the table and that will work on all resolutions. i've tried absolute percentages? and looked all over the web. If you can help, thank you.

i've done a diagram to illustrate my problem.



[/img]

Tyssen
Tyssen's picture
Offline
Moderator
Brisbane
Last seen: 6 years 7 weeks ago
Brisbane
Timezone: GMT+10
Joined: 2004-05-01
Posts: 8201
Points: 1386

&lt;div&gt; banner aligned to the right of a &lt;table&gt;

What code are you using so far?

How to get help
Post a link. If you can't post a link, jsFiddle it.
My blog | My older articles | CSS Reference

spooksie
Offline
newbie
Manchester
Last seen: 15 years 11 weeks ago
Manchester
Joined: 2005-09-20
Posts: 4
Points: 0

&lt;div&gt; banner aligned to the right of a &lt;table&gt;

Bog standard <table> for the content. <div> for the banner

Tyssen
Tyssen's picture
Offline
Moderator
Brisbane
Last seen: 6 years 7 weeks ago
Brisbane
Timezone: GMT+10
Joined: 2004-05-01
Posts: 8201
Points: 1386

&lt;div&gt; banner aligned to the right of a &lt;table&gt;

I meant CSS. Can you post the code for the actual page?

How to get help
Post a link. If you can't post a link, jsFiddle it.
My blog | My older articles | CSS Reference

spooksie
Offline
newbie
Manchester
Last seen: 15 years 11 weeks ago
Manchester
Joined: 2005-09-20
Posts: 4
Points: 0

&lt;div&gt; banner aligned to the right of a &lt;table&gt;

<div id="banner" style="position:absolute; right:10%; top:0px; width:120px; height:600px; z-index:1"><img src="images/banner_120x600.gif" width="120" height="600"></div>

That works but it doesnt keep to the right when changing resolution.

Tyssen
Tyssen's picture
Offline
Moderator
Brisbane
Last seen: 6 years 7 weeks ago
Brisbane
Timezone: GMT+10
Joined: 2004-05-01
Posts: 8201
Points: 1386

&lt;div&gt; banner aligned to the right of a &lt;table&gt;

Have you tried setting #banner float:right instead of positioning it absolutely?

How to get help
Post a link. If you can't post a link, jsFiddle it.
My blog | My older articles | CSS Reference

spooksie
Offline
newbie
Manchester
Last seen: 15 years 11 weeks ago
Manchester
Joined: 2005-09-20
Posts: 4
Points: 0

&lt;div&gt; banner aligned to the right of a &lt;table&gt;

Didnt work, basically with float right it went to the far end to the right. I need to make it sit next to the table with padding-left: 5px; (like on my visual).

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 5 years 47 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

&lt;div&gt; banner aligned to the right of a &lt;table&gt;

We need a link to the page please, to see your layout and rules in action.

Hugo.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me