[SOLVED] DIV Positioning Problem

This is a discussion on "[SOLVED] DIV Positioning Problem" within the Web Page Design section. This forum, and the thread "[SOLVED] DIV Positioning Problem are both part of the Design Your Website category.



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

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Jan 22nd, 2008, 15:51
Junior Member
Join Date: Oct 2007
Location: England
Age: 25
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
[SOLVED] DIV Positioning Problem

Hi guys,


I am new to CSS really and I am having a problem with an area i am hoping somebody can help me with.


Basically i have a design, which has a header, i want to position my navigation_div in a specific place over the header_div. I have positioned it using margin_top etc but it outputs it correctly in IE but not in Firefox. in FF the position is out by about 10px.

How the hell can i position it where i want it so that it outputs the same in IE and FF give or take a few pixels.


If someone could help i would really appreciate it as i am stuck at the moment.

Cheers

Dan
Reply With Quote

  #2 (permalink)  
Old Jan 22nd, 2008, 15:52
Reputable Member
Join Date: Oct 2007
Location: UK
Posts: 267
Thanks: 0
Thanked 0 Times in 0 Posts
Re: DIV Positioning Problem

have u got a link or could you post some code?
Reply With Quote
  #3 (permalink)  
Old Jan 22nd, 2008, 15:55
Junior Member
Join Date: Oct 2007
Location: England
Age: 25
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Re: DIV Positioning Problem

Hi

I haven't got any code as the only thing i have put on the site is the header, as i am still trying to position the navigation.


Do you know a general style that i could use to exactly position my div???


Dan
Reply With Quote
  #4 (permalink)  
Old Jan 22nd, 2008, 15:58
Reputable Member
Join Date: Oct 2007
Location: UK
Posts: 267
Thanks: 0
Thanked 0 Times in 0 Posts
Re: DIV Positioning Problem

well u can use position: absolute; on your navigation div that i wouldnt if i was you. Do u want it in the centre?
Reply With Quote
  #5 (permalink)  
Old Jan 22nd, 2008, 16:21
Aso's Avatar
Aso Aso is offline
Chief Moderator

SuperMember
Join Date: Oct 2007
Location: UK
Posts: 1,003
Blog Entries: 2
Thanks: 5
Thanked 23 Times in 20 Posts
Send a message via Skype™ to Aso
Re: DIV Positioning Problem

Different browsers have different defaults, and it's always easier to keep a design consistent if you reset certain attributes, namely margin and padding.

You can use
Code: Select all
* {
margin: 0;
padding: 0;
}
to reset all tags, or just specify margin: 0 and padding: 0 on any elements causing you problems.

If that's not the case, make sure you've specified a width and height for your header. Then try using margins and paddings on the nav to position it.

Alternatively, the better method might be to do what danny said. Set your header to
Code: Select all
position: relative;
then set your nav to
Code: Select all
position: absolute;
and either use top and left or bottom and right pixel values to position it relative to your header.

Example
Code: Select all
#nav {
top: 25px;
right: 40px;
This sets your #nav to 25px from the top of the header, and 40px from the right edge of the header
Last Blog Entry: The Google Misconception (Feb 3rd, 2008)
Reply With Quote
  #6 (permalink)  
Old Jan 23rd, 2008, 09:18
Junior Member
Join Date: Oct 2007
Location: England
Age: 25
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Re: DIV Positioning Problem

Hi guys

Thanks for your help, aso186. That piece of code for the css worked a treat. Thanks as well danny.

Will post the site when it is finished so that you can see what i was trying to acheive.


Thanks

Dan
Reply With Quote
  #7 (permalink)  
Old Jan 23rd, 2008, 09:22
welshstew's Avatar
Lead Administrator

SuperMember
Join Date: May 2007
Location: inside the outside
Posts: 1,388
Blog Entries: 13
Thanks: 1
Thanked 16 Times in 14 Posts
Re: DIV Positioning Problem

thread marked solved
__________________
WelshStew
Lead Administrator

tierney rides tboard - uk site | xtreme wales - extreme clothing
If you think I've helped, click the "Thanks"
webforumz - facebook | LinkedIn
Last Blog Entry: Web Standards Curriculum Launched (Jul 8th, 2008)
Reply With Quote
Reply

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
[SOLVED] div positioning problem danny322 Web Page Design 5 Nov 28th, 2007 01:05
[SOLVED] txt positioning in a div danny322 Web Page Design 2 Nov 13th, 2007 12:39
[SOLVED] positioning problem (ie and ff) danny322 Web Page Design 4 Nov 9th, 2007 15:31
[SOLVED] Link Color and problem with Image positioning! Ed Web Page Design 33 Oct 10th, 2007 11:17
Positioning problem - help please Rod_G Web Page Design 8 Apr 24th, 2006 12:03


All times are GMT. The time now is 19:23.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43