4WebHelp
 FAQ  •  Search  •  User Groups  •  Forum Admins  •  Smilies List  •  Statistics  •  Rules   •  Login   •  Register
Toggle Navigation Menu

 Proper layers - centering in browser
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic
Author Message
vulcanpimp
Junior WebHelper
Junior WebHelper


Joined: 11 Mar 2003
Posts: 14
Location: uk

PostPosted: Mon Mar 24, 2003 3:00 pm (14 years, 8 months ago) Reply with QuoteBack to Top

I have nearly always used proper layers - using the following syntax

<div id="Layer3" style="position:absolute; left:20px; top:274px; width:228px; height:22px; z-index:118" >
<a href="playwrite.html" class="myclass">Playwrite</a>
</div>

an example of its use would be

www.geocities.com/grahamrhodes

I always keep just one item to one layer whether that is a picture or text.

so far its never bothered me that the page doesn't center itself in the browser.
But does anyone know of a way to center pages in the browser using this strict layers method.

I thought of the following. Using JS to detect the amount of screen.availwidth and then testing the pages width. Then adjusting the content if there is miles of space. No idea
how to do this in netscape though.

thanks for reading
OfflineView User's ProfileFind all posts by vulcanpimpSend Personal MessageVisit Poster's Website
adam
Forum Moderator & Developer



Joined: 26 Jul 2002
Posts: 704
Location: UK

PostPosted: Mon Mar 24, 2003 8:18 pm (14 years, 8 months ago) Reply with QuoteBack to Top

text-align: center; in the style should do it...

________________________________
It's turtles all the way down...
OfflineView User's ProfileFind all posts by adamSend Personal MessageVisit Poster's Website
Daniel
Team Member



Joined: 06 Jan 2002
Posts: 2564

PostPosted: Mon Mar 24, 2003 8:24 pm (14 years, 8 months ago) Reply with QuoteBack to Top

Adam, I think vulcanpimp wants to center the layer itself on the page... Wink

________________________________
Image
OfflineView User's ProfileFind all posts by DanielSend Personal Message
adam
Forum Moderator & Developer



Joined: 26 Jul 2002
Posts: 704
Location: UK

PostPosted: Mon Mar 24, 2003 8:33 pm (14 years, 8 months ago) Reply with QuoteBack to Top

hmm...thats a little trickier. if the layer width was in percent, you could specify a margin-left so that there is equal space either side of it. I can't think of a way to do it with a fixed width.

________________________________
It's turtles all the way down...
OfflineView User's ProfileFind all posts by adamSend Personal MessageVisit Poster's Website
verto
Senior WebHelper
Senior WebHelper


Joined: 14 Jan 2002
Posts: 220
Location: Cambridge MA USA

PostPosted: Tue Mar 25, 2003 1:56 am (14 years, 8 months ago) Reply with QuoteBack to Top

hmmm... could be wrong, but my guess is you'll need DHTML.

You might try searching some of the sites specializing in DHTML scripts, like:

http://www.dhtmlshock.com/

________________________________
>>>>>>>>>>>>>
GENERAL DISCLAIMER:This disclaimer may be void where null in all cases unless explicitly not unprohibited or (p)re-exclusively assigned by sufficient presedimentation on behalf of every non-interested party to wit (or so it was said).
:::
.: :. . : :....: :.: .: :. verto .: :. . : :....: :.: .: :.
OfflineView User's ProfileFind all posts by vertoSend Personal Message
Hertzsprung
WebHelper
WebHelper


Joined: 30 Jul 2002
Posts: 56
Location: UK

PostPosted: Tue Mar 25, 2003 8:38 am (14 years, 8 months ago) Reply with QuoteBack to Top

I don't quite understand why you need to absolutely position everything, and even less why you need different z-indexes for each div box. I tried looking at your homepage in Mozilla1.3b and it broke Sad

You might try using default positioning and floating your navigation box left like this:

Code:
<div style="float: left">My nav box</div>Main content will flow around box.


Just a thought Smile

Impressive CV btw
OfflineView User's ProfileFind all posts by HertzsprungSend Personal MessageVisit Poster's Website
vulcanpimp
Junior WebHelper
Junior WebHelper


Joined: 11 Mar 2003
Posts: 14
Location: uk

PostPosted: Tue Mar 25, 2003 4:31 pm (14 years, 8 months ago) Reply with QuoteBack to Top

ended up just turning the layers into tables using dreamweaver (convert to tables)

then just added <center> and </center> covering the whole content.

guess I'm just lazy..always hated tables because they just don't make sense to a beginner



thanks for your help I'll try the suggestions
OfflineView User's ProfileFind all posts by vulcanpimpSend Personal MessageVisit Poster's Website
verto
Senior WebHelper
Senior WebHelper


Joined: 14 Jan 2002
Posts: 220
Location: Cambridge MA USA

PostPosted: Tue Mar 25, 2003 8:41 pm (14 years, 8 months ago) Reply with QuoteBack to Top

vulcanpimp wrote:
...guess I'm just lazy..always hated tables because they just don't make sense to a beginner...

guess i'm old skool then... always thot tables were much simpler than layers..

heh... u mite just think of them as div tags with less features (and mucho more tags) ... Wink

________________________________
>>>>>>>>>>>>>
GENERAL DISCLAIMER:This disclaimer may be void where null in all cases unless explicitly not unprohibited or (p)re-exclusively assigned by sufficient presedimentation on behalf of every non-interested party to wit (or so it was said).
:::
.: :. . : :....: :.: .: :. verto .: :. . : :....: :.: .: :.
OfflineView User's ProfileFind all posts by vertoSend Personal Message
Hertzsprung
WebHelper
WebHelper


Joined: 30 Jul 2002
Posts: 56
Location: UK

PostPosted: Wed Mar 26, 2003 7:56 pm (14 years, 8 months ago) Reply with QuoteBack to Top

verto wrote:
vulcanpimp wrote:
...guess I'm just lazy..always hated tables because they just don't make sense to a beginner...

guess i'm old skool then... always thot tables were much simpler than layers..

heh... u mite just think of them as div tags with less features (and mucho more tags) ... Wink

I'm a bit of old and new skool. I use div tags (though not z-index) for some layout, but use tables where CSS4 would otherwise have to be employed Wink
OfflineView User's ProfileFind all posts by HertzsprungSend Personal MessageVisit Poster's Website
Display posts from previous:      
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic


 Jump to:   




You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot edit your posts in this forum.
You cannot delete your posts in this forum.
You cannot vote in polls in this forum.


Page generation time: 0.054826 seconds :: 17 queries executed :: All Times are GMT
Powered by phpBB 2.0 © 2001, 2002 phpBB Group :: Based on an FI Theme