8 Replies Latest reply: Apr 20, 2012 9:48 AM by Overtim3 RSS

    Centering an item

    Overtim3

      I am having trouble centering something in my "Sublogo"

       

      Here is the site:

      http://www.humboldt.edu/cicd/index_test.htm

       

      You can see the like button is way to far right. Any ideas?

        • 1. Re: Centering an item
          sudarshan.t MVP

          I guess you're not using XFBML for Facebook Like code. You're using the iFrame version which is causing this issue.

           

          This will do the trick:

           

          Make the following change to your code in HTML and it should work:

          <div id="Sublogo" style="margin-left: -80px;">

          Try it out and let us know if it is sorted.

          • 2. Re: Centering an item
            Overtim3 Community Member

            that somewhat worked. i guess i gatta keep playing with margins and the height.. But then it throws off my other div ..

            • 3. Re: Centering an item
              Overtim3 Community Member

              what is the difference between iframe and XFBML?

              • 4. Re: Centering an item
                sudarshan.t MVP

                iframe is a HTML script that is considered vintage - mostly because it is not fully cross-browser compatible.

                xfbml is Facebook's proprietary script that runs off Javascript and works just fine across all browsers.

                 

                 

                 

                that somewhat worked. i guess i gatta keep playing with margins and the height.. But then it throws off my other div ..

                If it throws off your other divs, you could separate the DIV ids for your other content. Make an exclusive DIV only for the Facebook's like button and a separate div for other content following it. This should definitely work.

                • 5. Re: Centering an item
                  sudarshan.t MVP

                  This should help you too:

                   

                  There are two Like button implementations: XFBML and Iframe. The XFBML (also available in HTML5-compliant markup) version is more versatile, but requires use of the JavaScript SDK. The XFBML dynamically re-sizes its height according to whether there are profile pictures to display, gives you the ability (through the Javascript library) to listen for like events so that you know in real time when a user clicks the Like button, and it always gives the user the ability to add an optional comment to the like. If users do add a comment, the story published back to Facebook is given more prominence.

                  ~Taken from http://developers.facebook.com/docs/reference/plugins/like/

                  • 6. Re: Centering an item
                    Overtim3 Community Member

                    funny you would refer me to that site because that is same one where i got my code at. I've been tinkering with the code and i still cant seem to get it to go where i would like it to go which is in the center. :-/

                    • 7. Re: Centering an item
                      sudarshan.t MVP

                      When you say 'it throws off other div', could you send us a screenshot of what it looks like? Because when I tried it here, it worked just fine.

                      • 8. Re: Centering an item
                        Overtim3 Community Member

                        Oh, it was something else I had changed. Somehow dreamweaver managed to put a space in the wrong spot and made my whole page look funky. I did manage to find the extra space and correct it.

                         

                        Thank you for all of your help