Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 839487
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T05:28:15+00:00 2026-05-15T05:28:15+00:00

I’m having trouble left aligning a related links div inside a block of text,

  • 0

I’m having trouble left aligning a related links div inside a block of text, exactly 250 pixels from the top of a content area, while retaining word wrapping. I attempted to do this with absolute positioning, but the text in the content area doesn’t wrap around the content.

I would just fix the related links div in the content, however, this will display on an article page, so I would like for it to be done without placing it in a specific location in the content.

Is this possible? If so, can someone help me out with the CSS for this?

Example image of desired look & feel…

UPDATE: For simplicity, I’ve added example code. You can view this here: http://www.focusontheclouds.com/files/example.html.

Example HTML:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
  <title>Example Page</title> 
  <style>
    body {
      width: 400px; 
      font-family: Arial, sans-serif;
    }
    h1 {
      font-family: Georgia, serif; 
      font-weight: normal;
    }
    .relatedLinks {
      position: relative;
      width: 150px; 
      text-align: center; 
      background: #f00; 
      height: 300px; 
      float: left; 
      margin: 0 10px 10px 0;
    }
  </style> 
</head>
<body> 
  <div class="relatedLinks"><h1>Related Links</h1></div>
  <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc tempus est luctus ante auctor et ullamcorper metus ullamcorper. Vestibulum molestie, lectus sed luctus egestas, dolor ipsum aliquet orci, ac bibendum quam elit blandit nulla.</p>
  <p>In sit amet sagittis urna. In fermentum enim et lectus consequat a congue elit porta. Pellentesque nisl quam, elementum vitae elementum et, facilisis quis velit. Nam odio neque, viverra in consectetur at, mollis eu mi. Etiam tempor odio vitae ligula ultrices mollis. </p>
  <p>Donec eget ligula id augue pulvinar lobortis. Mauris tincidunt suscipit felis, eget eleifend lectus molestie in. Donec et massa arcu. Aenean eleifend nulla at odio adipiscing quis interdum arcu dictum. Fusce tellus dolor, tempor ut blandit a, dapibus ac ante. Nulla eget ligula at turpis consequat accumsan egestas nec purus. Nullam sit amet turpis ac lacus tincidunt hendrerit. Nulla iaculis mauris sed enim ornare molestie. </p>
  <p>Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Maecenas non purus diam. Suspendisse iaculis tincidunt tempor. Suspendisse ut pretium lectus. Maecenas id est dui.</p>
  <p>Nunc pretium ipsum id libero rhoncus varius. Duis imperdiet elit ut turpis porta pharetra. Nulla vel dui vitae ipsum sollicitudin varius. Duis sagittis elit felis, quis interdum odio. </p>
  <p>Morbi imperdiet volutpat sodales. Aenean non euismod est. Cras ultricies felis non tortor congue ultrices. Proin quis enim arcu. Cras mattis sagittis erat, elementum bibendum ipsum imperdiet eu. Morbi fringilla ullamcorper elementum. Vestibulum semper dui non elit luctus quis accumsan ante scelerisque.</p>
</body>
</html>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T05:28:16+00:00Added an answer on May 15, 2026 at 5:28 am

    UPDATE2:

    Spoke too soon. browsershots.org shows that it barfs on Opera 5 (I used an earlier version) and some editions of Safari, and (of course) IE7 and below (IE8 is OK).

    UPDATE:

    The following code, shamelessly tweaked from Dan M’s answer, seems to work in modern browsers.

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
    <html>
    <head>
        <title>Nice Sidebar Box</title>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <style  type="text/css">
            .wrapper
            {
                width:              500px;
                margin:             0 30px;
                line-height:        1.5;
                padding-top:        250px;
            }
            .content
            {
                margin:             0;
                margin-top:         -250px;
            }
            .relatedLinks
            {
                height:             300px;
                width:              240px;
                margin:             0 1em;
                background-color:   red;
                float:              left;
            }
        </style>
    </head>
    <body>
    <div class="wrapper">
        <div class="relatedLinks">
            Related links content here...
        </div>
        <div class="content">
            <p>
            Do not argue with a spouse who is packing your parachute.
            </p>
            <p>
            Three weeks ago, she learned how to drive. Last week she learned how to aim it.
            </p>
            <p>
            How, if they can't see their reflections, do vampires always get their hair so nice?
            </p>
            <p>
            My wife will buy anything marked down. Last year she bought an escalator.
            </p>
            <p>
            Sign in a men's room: "This is not urinal, it's ourinal, so please flush."
            </p>
            <p>
            She was at the beauty shop for two hours. That was only for the estimate.
            </p>
            <p>
            For those of you who've never been to Las Vegas, there the "G string" is known as the gownless
            evening strap.
            </p>
            <p>
            Hollywood's a town where they shoot entirely too many movies and not enough actors.
            </p>
            <p>
            Three weeks ago, she learned how to drive. Last week she learned how to aim it.
            </p>
            <p>
            How, if they can't see their reflections, do vampires always get their hair so nice?
            </p>
            <p>
            My wife will buy anything marked down. Last year she bought an escalator.
            </p>
            <p>
            Sign in a men's room: "This is not urinal, it's ourinal, so please flush."
            </p>
            <p>
            She was at the beauty shop for two hours. That was only for the estimate.
            </p>
            <p>
            For those of you who've never been to Las Vegas, there the "G string" is known as the gownless
            evening strap.
            </p>
            <p>
            Hollywood's a town where they shoot entirely too many movies and not enough actors.
            </p>
        </div>
    </div>
    </body>
    </html>
    

    Old Answer:

    This may not be possible with just CSS. Consider this page:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
    <html>
    <head>
        <title>Nice Sidebar Box</title>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <style  type="text/css">
            .content
            {
                width:              500px;
                margin:             2em;
                line-height:        1.5;
            }
            .relatedLinks
            {
                position:           relative;
                top:                250px;
                height:             300px;
                width:              240px;
                margin:             1em;
                background-color:   red;
                float:              left;
                margin-bottom:      250px;
                display:            inline-block;
            }
        </style>
    </head>
    <body>
    <div class="content">
        <p>
        Do not argue with a spouse who is packing your parachute.
        </p>
        <div class="relatedLinks">
            Related links content here...
        </div>
        <p>
        Three weeks ago, she learned how to drive. Last week she learned how to aim it.
        </p>
        <p>
        How, if they can't see their reflections, do vampires always get their hair so nice?
        </p>
        <p>
        My wife will buy anything marked down. Last year she bought an escalator.
        </p>
        <p>
        Sign in a men's room: "This is not urinal, it's ourinal, so please flush."
        </p>
        <p>
        She was at the beauty shop for two hours. That was only for the estimate.
        </p>
        <p>
        For those of you who've never been to Las Vegas, there the "G string" is known as the gownless
        evening strap.
        </p>
        <p>
        Hollywood's a town where they shoot entirely too many movies and not enough actors.
        </p>
    </div>
    </body>
    </html>
    

    Notice that the float handles correctly next to the sidebar and below it (All bets are off in IE6).

    But the left margin is wrong for the text above the sidebar — not counting the first paragraph.

    That first paragraph appears before the sidebar in the html code. Not only that, but it bumps the sidebar down — it’s no longer at 250px.

    I’m pretty sure I can use javascript to fudge around this — after the page is loaded — but I’m NOT recommending that approach.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a text area in my form which accepts all possible characters from
I'm having trouble keeping the paragraph square between the quote marks. In firefox the
I have a bunch of posts stored in text files formatted in yaml/textile (from
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
Does anyone know how can I replace this 2 symbol below from the string

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.