Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Mar 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Alignment Problem

    So, i have a code
    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:
    Code:
    <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 ?
    You can see my problem here: http://www.ro-musicshare.biz.ht

  • #2
    Senior Coder
    Join Date
    Feb 2009
    Location
    Ilkley, West Yorkshire, UK
    Posts
    2,956
    Thanks
    9
    Thanked 727 Times in 721 Posts
    Remove the align attribute from #container and add to your css:

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

  • #3
    New Coder
    Join Date
    Sep 2009
    Posts
    73
    Thanks
    5
    Thanked 9 Times in 9 Posts
    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:

    Code:
    <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

  • #4
    Senior Coder
    Join Date
    Feb 2009
    Location
    Ilkley, West Yorkshire, UK
    Posts
    2,956
    Thanks
    9
    Thanked 727 Times in 721 Posts
    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....

  • #5
    New Coder
    Join Date
    Sep 2009
    Posts
    73
    Thanks
    5
    Thanked 9 Times in 9 Posts
    Quote Originally Posted by SB65 View Post
    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.


    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.

  • #6
    New to the CF scene
    Join Date
    Mar 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs up

    Quote Originally Posted by ARCLite Studio View Post
    SB65 - Ok, I'll phrase it differently...
    Thanks! That's the answer


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •