User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 422,560 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,594 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 711 | Replies: 1
Reply
Join Date: Jun 2007
Posts: 1
Reputation: garyewen is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
garyewen garyewen is offline Offline
Newbie Poster

Page top not top

  #1  
Jun 15th, 2007
I am attempting to use style.top for a div element that exists in the root of the body tag. but its idea of where top = 0 is about 40 pixels out. i have tried adding border=0 and padding=0 to the style of the body tag but it doesnt work.

Can anyone make any suggestions? Cheers
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jan 2007
Posts: 2,556
Reputation: MidiMagic is on a distinguished road 
Rep Power: 7
Solved Threads: 114
MidiMagic's Avatar
MidiMagic MidiMagic is offline Offline
Posting Maven

Re: Page top not top

  #2  
Jun 19th, 2007
try
{margin: none; border: none; padding: none;}
You need all three, because different browsers have different default styles for both body and div. Apply these styles to both the body tag and the div inside. If you need padding inside the div tag, nest another div inside it and put the padding style there.

Also the name for this is vertical-align: top; And vertical align doesn't always work right if padding is in the same object's style.
Daylight-saving time uses more gasoline
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb JavaScript / DHTML / AJAX Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum

All times are GMT -4. The time now is 1:23 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC