PDA

View Full Version : Alignment Problem



badboyvlad
Mar 2nd, 2012, 05:30 PM
So, i have a code :)

<body>

<div id="container" align="center">
<div id="topbord" class="topborder"></div>
<div id="maindiv" style="background-color: #e2e2e2; width:954px">
<div id="videoDiv" style="width:712px; height:380px; left:0px;">Loading...</div>



</div>
<div id="bottopborder" class="bottopborder"></div>
</div>


</body>
My problem is:

<div id="videoDiv" style="width:712px; height:380px; left:0px;">Loading...</div> (youtube player inside) ...
this sould be aling 0 px from left but is still center :|
Why? Is something wrong whit my code ? :confused:
You can see my problem here: http://www.ro-musicshare.biz.ht

SB65
Mar 2nd, 2012, 05:40 PM
Remove the align attribute from #container and add to your css:


#container{width:954px;margin:0 auto}

ARCLite Studio
Mar 3rd, 2012, 05:37 AM
SB65's recommendation changes this to a two column layout, but it does move the "loading..." to the left 0,0 position of the containing DIV. If you wanted this to be a two colum layout then please follow what he stated. If you wanted the video box centered, but the "Loading..." moved to the upper left of that box then follow code below:



<div id="videoDiv" style="width:712px; height:380px; left:0px; text-align:left;">Loading...</div>

adding the: text-align:left; into the inline style declaration moves the "Loading..." to the proper position you want if i understand what your wanting.


That having been said, I agree with SB65 that the code as written should be changed in any case to remove the align="center" from container DIV and adjusted ot use CSS for your results.


ARCLite Studio

SB65
Mar 3rd, 2012, 08:33 AM
SB65's recommendation changes this to a two column layout

No it doesn't.


, but it does move the "loading..." to the left 0,0 position of the containing DIV.

Whixh is what the OP asked for....

ARCLite Studio
Mar 3rd, 2012, 05:46 PM
No it doesn't.



Whixh is what the OP asked for....

SB65 - Ok, I'll phrase it differently:

Your code uncenters the "videodiv" and shifts the entire DIV to upper left of the "Maindiv", this also includes shifting the text "Loading..." to the left. This creates a two columm **Appearance**, The videodiv filling about 85% of Maindiv, the rest of maindiv just unoccupied.
http://arclitestudio.com/temp/sb65-post.png

OP - Maybe I misunderstood what he wanted, I thought he wanted the "Loading..." text in the upper left corner of videodiv instead of it being centered. but still wanted the videodiv to be centered on the maindiv container. - In which case your code would have been wrong.

In any case he has answers.

badboyvlad
Mar 31st, 2012, 03:45 PM
SB65 - Ok, I'll phrase it differently...
Thanks! That's the answer:thumbsup: