SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    Wishful Thinking webmasternovis's Avatar
    Join Date
    Jul 2002
    Location
    England
    Posts
    430
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Positioning text to bottom of div

    Hi all,

    I have a div set out like the following:

    Code:
    <div>
    Some text here.
    <a href="#">Link Here</a>
    I need the link at the bottom to be right at the bottom of the div though, and this is something that I'm struggling with. I've tried absolute positioning, relative positioning but I can't get anything to work. Could anyone help?

    Thanks,
    Mike

  2. #2
    SitePoint Member
    Join Date
    Jun 2008
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You could put the link in a div inside the container div, and set the height, width and positioning of the inner div. That should do it.

  3. #3
    Design Your Site Team bronze trophy Erik J's Avatar
    Join Date
    May 2007
    Location
    Countryside, Sweden
    Posts
    3,407
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Have you tried positioning like this?
    Code:
    div {
    	position: relative;
    	padding-bottom: 30px;
    }
    div a {
    	position: absolute;
    	bottom: 0;
    	left: 0;
    }
    HTML Code:
    <div>
    	<p>Some text here.</p>
    	<a href="#">Link Here</a>
    </div>
    Happy ADD/ADHD with Asperger's

  4. #4
    Wishful Thinking webmasternovis's Avatar
    Join Date
    Jul 2002
    Location
    England
    Posts
    430
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks erik, that works perfectly.


Bookmarks

Posting Permissions

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