Log In · Register

 
I need some help with coding, Coding website templates
CandyPop
post Jan 5 2010, 07:32 PM
Post #1


"One hell of a butler"
***

Group: Member
Posts: 95
Joined: Nov 2008
Member No: 696,422



I'm having a hard time coding my layouts so that it can be aligned correctly with all computer screen widths.

For example, I code/design my layouts on a laptop and the screen is really wide. Then I go view the layout on another computer with a thinner screen width and everything is misaligned and just horrible. What can I do to fix that?
 
 
Start new topic
Replies
Mikeplyts
post Jan 10 2010, 02:40 PM
Post #2


Mel Blanc was allergic to carrots.
*******

Group: Official Designer
Posts: 6,371
Joined: Aug 2008
Member No: 676,291



There's always that little absolute positioning hack.

CODE
div#id {
    width:###px;
    position:absolute;
    top:###px;
    left:50%;
    margin-left:-###px; /* This is half the amount of pixels that you input into the width property */
}


It's kind of pointless though, using the margin:auto; method that FACreate mentioned is a bunch better and it saves time and server space.
 
TheOn3LeftBehind
post Jan 24 2010, 09:57 PM
Post #3


~* Traditional Witch
***

Group: Member
Posts: 73
Joined: Jul 2007
Member No: 553,061



QUOTE(Mikeplyts @ Jan 10 2010, 01:40 PM) *
There's always that little absolute positioning hack.

CODE
div#id {
    width:###px;
    position:absolute;
    top:###px;
    left:50%;
    margin-left:-###px; /* This is half the amount of pixels that you input into the width property */
}


It's kind of pointless though, using the margin:auto; method that FACreate mentioned is a bunch better and it saves time and server space.


Yeah, using left:50% is your best bet.
 

Posts in this topic


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