Results 1 to 2 of 2

Thread: How to align the contents of a div

  1. #1
    bUrGe Guest

    How to align the contents of a div

    Hi there,

    I want to have a footer on my web page, that has a horizonal UL within it and a bit of text alongside it, as below:

    http://www.mnetuk.com/Clients/LBACre...s/Required.jpg

    I want to center align the div like the screenshot below

    http://www.mnetuk.com/Clients/LBACre...res/Actual.jpg

    How can I achieve this? If I just center align the text in the div, the text to the right of the UL centers, but the UL stays to the left, as the attached screenshot shows ('actual.jpg').

    Please help!

  2. #2
    Join Date
    Feb 2006
    Location
    Salisbury UK
    Posts
    4,332
    Your image links don't work, but as a guide you can always create a footer containing div and put two or more divs inside and float one left or center and the other float: right; then you can position the text inside any of them independently perhaps with text-align: right; for the right one.

    This is code I used once:-
    <div id="footer">

    <div class="navfloatleft">
    <p class="margin0">&copy; My Name 2007</p>
    </div>

    <div class="navfloatright">
    <p class="margin0" style="text-align: right"><a href="#top" title="Back to top">top</a> | <a href="localpeople1.html" title="Local People 1">Prev</a> | <a href="../ancestors/ancestors1865to1900.html" title="Ancestors 1865 to 1900">Next</a>
    </p>
    </div>

    <div>
    <p class="margin0">This div will move up into the space between the left and right floated divs (if there is room) and fill the remaining width if it has no width stated.</p>
    </div>

    </div><!--end of #footer-->
    Code downloaded to my PC will be deleted in due course.
    WIN7; IE9, Firefox, Opera, Chrome and Safari for Windows; screen resolution usually 1366*768.
    Also IE6 on W98 with 800*600 and IE8 on Vista 1440*900.

Similar Threads

  1. Div headers and footers and resize contents
    By alanmac in forum Web Design, HTML Reference and CSS
    Replies: 1
    Last Post: 05 Dec 2008, 02:25 PM

Posting Permissions

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