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 4 of 4
  1. #1
    New Coder
    Join Date
    May 2011
    Location
    Chicago, IL
    Posts
    19
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Help with text positioning

    Can someone please help me position my text entitled "Latest News..." not all the way left but not center, I would like it aligned with the main picture on the site. I have uploaded two pictures, one showing the way I would like it to appear and the other showing how it is incorrectly displayed.




  • #2
    Senior Coder
    Join Date
    Feb 2009
    Location
    Ilkley, West Yorkshire, UK
    Posts
    2,956
    Thanks
    9
    Thanked 727 Times in 721 Posts
    For a start, get a doctype on your page - you will struggle to get any consistency cross-browser without one.

    Replace your deprecated <center> tags with <div id="wrap"> instead, and centre it with css as follows:

    Code:
    #wrap{
    width:1000px;/*assign a width*/
    margin:0 auto;/*centre the div*/
    text-align:center;/*centre everything within the div*/
    }
    Move your "Latest news" code t o sit inside#wrap, give that code an id of "latest" and then use css to align it to the left rather than the centre:

    Code:
    #latest{text-align:left}
    I'd also suggest replacing your deprecated <font> tags with css.

  • #3
    New Coder
    Join Date
    May 2011
    Location
    Chicago, IL
    Posts
    19
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Thank you for your response, and I know this is a beginner's question because I am a beginner, but where and how do I implement all those codes you just gave me? I'm not familiar with CSS or labeling new #"tags" but I am a fast learner and am eager to study.

  • #4
    Senior Coder
    Join Date
    Feb 2009
    Location
    Ilkley, West Yorkshire, UK
    Posts
    2,956
    Thanks
    9
    Thanked 727 Times in 721 Posts
    Have a look here for some basic tutorials:

    http://htmldog.com/guides/htmlbeginner/

    or see the sticky at the top of the page. That should help with the basic set up and how to use css - the code quoted above will form part of your css file.


  •  

    Posting Permissions

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