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 2 of 2
  1. #1
    New Coder
    Join Date
    May 2007
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Aligning text and links

    I have the following HTML which I can't get to line up the way I have in mind. What I'd like is for there to be two lines - one with text followed by a link, and the next with just a link.

    Both lines should be right-aligned within the block with class "inner".

    Code:
    <div class="links">
    				<div class="inner">
    				<div class="group">
    					Text describing link1 <a href="link1.html">Link 1</a>
    				</div>
    				<a href="link2.html">Link 2</a>
    				</div>
    			</div>
    I tried setting the "links" block to float left and the "inner" block to float right, but everything just appears left aligned against the "inner" block. If float the "group" block and the second <a> to the right, then it gets misaligned.

    I've tried multiple combinations of markup but nothing seems to work. Is the design the way I described above possible?

    Thanks.

  • #2
    Regular Coder
    Join Date
    Feb 2007
    Location
    Canada
    Posts
    924
    Thanks
    10
    Thanked 56 Times in 55 Posts
    Spans, paragraphs and floats work.

    Untested:
    [html]
    <div style="float:left; width: 400px; ">
    <p style = "float:right">
    text, text, text here
    <img blah />
    <a blah>what eve rwh ateve rwh ateve rwhat ever</a>
    </p>
    <span style="float:right; clear:both;"><img blah2 /></span>
    </div>
    [/html]
    Try it...
    Last edited by jlhaslip; 10-07-2007 at 12:32 AM.


  •  

    Posting Permissions

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