Log In · Register

 
 
Closed TopicStart new topic
Misaligned Page
YourSuperior
post Feb 17 2008, 12:25 AM
Post #1


;)
*******

Group: Staff Alumni
Posts: 9,573
Joined: Feb 2005
Member No: 99,124



Well I just finished coding my layout, and my friend is using a different resolution and they said the layout looks really misaligned on their computer and I use 1280x800 resolution. Can someone help me fix it? This is what it looks like on my computer:



Here's the site: http://takecamera.com/alvinward/test.php
 
broken-doll
post Feb 17 2008, 01:25 AM
Post #2


Senior Member
***

Group: Member
Posts: 35
Joined: Dec 2007
Member No: 602,080



I suppose you change your "#content" code to absolute positioning, and use margin-left, instead of just left.
 
libertie
post Feb 17 2008, 03:21 AM
Post #3


This bag is not a toy.
*******

Group: Staff Alumni
Posts: 3,090
Joined: Oct 2007
Member No: 583,108



QUOTE
#content {
/* Sets the position of the main div as well as the default fonts for the content */
position: relative;
width: 591px;
overflow: none;
font-family: "Times New Roman", Times, serif;
font-size: 12px;
color: #FFFFFF;
text-align: justify;
left: 50%;
margin-left: -390px;

top: -140px;
}


This code, in every resolution, will position the left side of the div exactly center of the page - then you need to move it to the left, so it will be exactly centered. What I usually do then is divide the total width of the content in half - it's about 780px - and give it a negative margin-left.

You would, of course, want to do the same for the sidebar only you wouldn't move it as far left (you may even have a positive margin).
 
YourSuperior
post Feb 17 2008, 03:53 AM
Post #4


;)
*******

Group: Staff Alumni
Posts: 9,573
Joined: Feb 2005
Member No: 99,124



Hmm, but that makes it misaligned for me. :-\
 
YourSuperior
post Feb 17 2008, 06:54 PM
Post #5


;)
*******

Group: Staff Alumni
Posts: 9,573
Joined: Feb 2005
Member No: 99,124



Forgive me for double posting, but would it be better if I code it with Dreamweaver?
 
libertie
post Feb 18 2008, 01:09 AM
Post #6


This bag is not a toy.
*******

Group: Staff Alumni
Posts: 3,090
Joined: Oct 2007
Member No: 583,108



I prefer to use a text editor, personally. I like having full control over my code, knowing what everything is, etc, and I don't like the extra stuff DW puts in. But if you just used the code as I posted it, it probably won't work - basically, you'll want to play around with the numbers a little bit, particularly the margin-left property.
 
YourSuperior
post Feb 18 2008, 07:55 PM
Post #7


;)
*******

Group: Staff Alumni
Posts: 9,573
Joined: Feb 2005
Member No: 99,124



But can Dreamweaver do multi-resolution compatibility?
 
libertie
post Feb 19 2008, 06:57 PM
Post #8


This bag is not a toy.
*******

Group: Staff Alumni
Posts: 3,090
Joined: Oct 2007
Member No: 583,108



I'm sure it can, but I'm not really the right person to tell you whether or not it'd be easier, because I just don't like using it. I still think it would be easier, since you've already made the layout, to fix the code to make it fluid rather than trying to do it in a different program.

Maybe someone who does use Dreamwaver can give you some pointers?
 
YourSuperior
post Feb 19 2008, 07:59 PM
Post #9


;)
*******

Group: Staff Alumni
Posts: 9,573
Joined: Feb 2005
Member No: 99,124



What's a perfect way to design a page where it's aligned in most resolutions/browsers?
 
libertie
post Feb 19 2008, 11:06 PM
Post #10


This bag is not a toy.
*******

Group: Staff Alumni
Posts: 3,090
Joined: Oct 2007
Member No: 583,108



Have you tried something like this? Try using it in place of your content/sidebar:

CODE
#content {
    /* Sets the position of the main div as well as the default fonts for the content */
    position: relative;
    width: 591px;
    overflow: none;
    font-family: "Times New Roman", Times, serif;
    font-size: 12px;
    color: #FFFFFF;
    text-align: justify;
    left: 50%;
    margin-left: -386px;
        top: -140px;
}
#navigation {
    /* Sets the position for the sidebar as well as the default module fonts */
    position: absolute;
    width: 164px;
    overflow: hidden;
    font-family: "Times New Roman", Times, serif;
    font-size: 12px;
    color: #FFFFFF;
    text-align: justify;
    top: -1px!important;
              top: -420px;
    left: 50%;
    margin-left: 218px;
}
 

Closed TopicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members: