Webforumz's RSS FeedRSS Webforumz RegistrationRegister Contact Webforumz StaffContact

A Better Way of Positioning

This is a discussion on "A Better Way of Positioning" within the Web Page Design section. This forum, and the thread "A Better Way of Positioning are both part of the Design Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Jul 27th, 2007, 14:04
Up'n'Coming Member
Join Date: Nov 2006
Location: Ipswich
Posts: 58
Thanks: 0
Thanked 0 Times in 0 Posts
A Better Way of Positioning

Hello

I wondered if someone could suggest a better way of doing this as I've more than likely found the most inefficient way of doing it.

What this achieves is here...

www.slightlyaskew.co.uk/deadship/index.php

essentially the row where the text is is three images, the middle one being used as a background in the "main_text" DIV. I spent an age trying to stop the DIVs from line breaking, and finally came up with the code below. Please don't comment on the rest of the site! I know it's nowhere near finished. One step at a time and all that.

Thank you in advance for any help and advice.

Christoff
x

My CSS

Code: Select all
 
wrapper {width:720px; height:255px;}
   .inliners {float:left;}
   #main_text {width:308px; height:255px; background-image:url(images/main_centre.gif); overflow-x:hidden; overflow-y:auto; background-position:fixed; background-repeat:no;}
My HTML

Code: Select all
 
<div id="wrapper">
 
<div class="inliners"><img src="images/main_ship.gif" alt="Dead Ship Records"></div>
 
<div class="inliners"><div id="main_text">...lots of text...</div></div>
 
<div class="inliners"><img src="images/main_middle_right.gif" alt=""></div>
 
</div>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2  
Old Jul 27th, 2007, 14:44
Elite Veteran
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: A Better Way of Positioning

Hmmm ... you know what? Since you're using a scrolling div, why not make the background 1 image then all you have to do is position you scrolling div and you menu.

That's how I would do it. Much simpler and cleaner.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Jul 27th, 2007, 14:48
Up'n'Coming Member
Join Date: Nov 2006
Location: Ipswich
Posts: 58
Thanks: 0
Thanked 0 Times in 0 Posts
Re: A Better Way of Positioning

I like your thinking.

Ummm... how would I got about doing this? Presumably i need my text DIV to overlap the DIV with my image in it? Or am I already barking up the wrong tree?

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Jul 27th, 2007, 14:54
Elite Veteran
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: A Better Way of Positioning

Apply your background (the paper thing) to body { }

Then all you would need is 2 divs ... 1 for the content and 1 for the nav
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old Jul 27th, 2007, 15:05
Up'n'Coming Member
Join Date: Nov 2006
Location: Ipswich
Posts: 58
Thanks: 0
Thanked 0 Times in 0 Posts
Re: A Better Way of Positioning

Ah yes I see. Never thought of doing it that way for some reason.

What's the best way of positioning these DIVs so they overlap the the existing image? If I use absolute references, will I come unstuck with different screen sizes?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6  
Old Jul 27th, 2007, 15:12
Elite Veteran
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: A Better Way of Positioning

Since the existing image is applied as a background, there is no problem.

You could do something like this
Code: Select all
html {
    background-color: #fff;
    margin: 0;
    padding: 0;
}


body {
    width: 720px;
    background: #fff url(image.jpg) no-repeat 0 0;
}

#content {
    width: 308px;
    height: 255px;
    float: right;
    margin-right: 20px; <<<------- you'll need to adjust this 
    overflow: auto;
    clear: both;
}

#navigation {
   clear: both;
   width: ....
}
Something like this ... I haven't tested however ... the fingers just started writing
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7  
Old Jul 27th, 2007, 15:21
Up'n'Coming Member
Join Date: Nov 2006
Location: Ipswich
Posts: 58
Thanks: 0
Thanked 0 Times in 0 Posts
Re: A Better Way of Positioning

Thanks!

So I use margin-right and margin-top in the Content DIV to position the text over the image? And a similar thing for the navigation DIV?

Sorry to take up your time! You can have two sheep as a token of my appreciation.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8  
Old Jul 27th, 2007, 15:22
Elite Veteran
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: A Better Way of Positioning

Basically yeah ....
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #9  
Old Jul 27th, 2007, 15:31
Up'n'Coming Member
Join Date: Nov 2006
Location: Ipswich
Posts: 58
Thanks: 0
Thanked 0 Times in 0 Posts
Re: A Better Way of Positioning

But doesn't that mean that the text will be in a different place depending on the size of the users display?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #10  
Old Jul 27th, 2007, 15:33
Elite Veteran
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: A Better Way of Positioning

It shouldn't ... Try it out ... you'll see.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #11  
Old Jul 27th, 2007, 15:33
Marc's Avatar
Staff Manager

SuperMember
Join Date: Apr 2007
Location: Scotland, UK
Posts: 1,870
Thanks: 1
Thanked 23 Times in 23 Posts
Re: A Better Way of Positioning

nope, as long as the image is in the same place, which it is.
__________________
Thanks
Marc
Staff Manager - Want to be a Moderator? PM me.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
div line breaks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
CSS and positioning djme Web Page Design 6 Feb 3rd, 2006 14:27
Positioning with CSS Tino Web Page Design 8 Jan 21st, 2006 16:45
css positioning ivyholly Web Page Design 14 Dec 20th, 2005 19:43
Positioning with css Hub Web Page Design 12 Dec 13th, 2005 20:45
div positioning benbacardi Web Page Design 10 May 24th, 2004 13:25


All times are GMT. The time now is 16:29.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8