Submit Your Article Webforumz RegistrationAnnouncements Contact Webforumz StaffContact
Home Resources Blogs Meet the Team Contact Register
 

Go Back   WebForumz.com > The Code > HTML, XHTML and CSS

Reply
 
LinkBack Thread Tools
Old May 26th, 2008, 11:22 AM   #1
New Member
 

Join Date: May 2008
Location: Aspen, CO
Age: 27
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 ZekeLL is on a distinguished road
Problems with CSS positioning

Hi guys, when I try to create layers (AP divs) with Dreamweaver, everything looks great, but when I preview that in a browser, the layers change their positions.

I am very frustrated since I've been trying to figure out why for almost 2 days, and I can't. Please help me!

Check out this screenshot: http://www.theoutsourcingcompany.com...ges/proof1.jpg

This is the code:

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Test</title>
<style type="text/css">
<!--
#maincontent {
    left:186px;
    top:27px;
    width:80%;
    height:608px;
    z-index:1;
    margin: 0 auto;
    background-repeat: no-repeat;
    background-position: center center;
    position: relative;
    text-align: center;
}
#Name {
    position:absolute;
    left:372px;
    top:95px;
    z-index:1;
}
#Email {
    position:absolute;
    left:372px;
    top:140px;
    z-index:1;
}
#Phone {
    position:absolute;
    left:372px;
    top:185px;
    z-index:1;
}
.fontfields {
    font-size: 24px;
}
-->
</style>
</head>

<body>

<div id="maincontent">
<form>
    <div id="Name">
          <input name="Name" type="text" class="fontfields" id="Name2" />
    </div>
    <div id="Email">
          <input name="Name" type="text" class="fontfields" id="Email2" />
    </div>
    <div id="Phone">
          <input name="Name" type="text" class="fontfields" id="Phone2" />
    </div>
    <img src="http://www.theoutsourcingcompany.com/tryarg/images/form.jpg" width="650" height="608" />
</form>
</div>

</body>
</html>
If you know what the problem is, please help me. I am really confused with absolute, relative, fixed, and static positioning. I understand the concepts but I can't position the layers wherever I want.

Thank you!
ZekeLL is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old May 26th, 2008, 11:27 AM   #2
Most Reputable Member
SuperMember
 

Join Date: Nov 2005
Age: 28
Posts: 1,546
Thanks: 1
Thanked 11 Times in 11 Posts
Rep Altering Power: 0 saltedm8 will become famous soon enough saltedm8 will become famous soon enough
Re: Problems with CSS positioning

i am not quite sure what you want to do, but i have 2 solutions

the first is to remove

Code:
    left:186px;
    top:27px;
only do that if you want it centred

or if you are positioning to the above position, remove this

Code:
 margin: 0 auto;
basically, you are contradicting yourself and confusing the browser

Last edited by saltedm8; May 26th, 2008 at 11:30 AM..
saltedm8 is offline  
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

Bookmarks

Tags
css , positioning


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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] positioning problems danny322 HTML, XHTML and CSS 6 November 9th, 2007 07:26 AM
Text Positioning Problems Ed HTML, XHTML and CSS 15 October 7th, 2007 11:09 PM
problems positioning with css in IE bengtec HTML, XHTML and CSS 3 September 24th, 2007 04:47 AM
IE Experts please help. Positioning problems... jay019 HTML, XHTML and CSS 17 July 27th, 2007 12:21 PM
Firefox Positioning Problems mikka23 HTML, XHTML and CSS 8 November 17th, 2006 05:37 AM


Search Engine Optimization by vBSEO 3.2.0 RC8