treehouse : what would you like to learn today?
Web Design Web Development iOS Development

Aligment problem?

  • I`m using a twitter jquery plugin to get the latest tweets inside a div and i want to add " follow us on twitter " under the tweet but i can`t do this

    <!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">
    <html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">
    <head>
    <title></title>
    <style>
    .tweet {
    font-family: Georgia, serif;
    font-size: 1.1em;
    color: #085258;
    width:237px;
    padding:10px 0 0 60px; }

    .tweet .tweet_list {
    background: url(../images/twitter_bg.png) no-repeat scroll 0 100%;
    height:179px;
    -webkit-border-radius: .5em;
    list-style-type: none;
    margin: 0;
    padding: 0; }

    .tweet .tweet_list li {
    width:180px;
    overflow: auto;
    line-height: 1.5;
    padding: 8px 5px 5px 30px; }

    .tweet .tweet_list li a {
    color: #0C717A; }

    .tweet .tweet_list .tweet_even {
    background-color: #91E5E7; }

    </style>
    <script type=\"text/javascript\" src=\"http://ajax.googleapis.com/ajax/libs/jquery/1.3.1/jquery.min.js\"></script>
    <script type=\"text/javascript\" src=\"scripts/jquery.tweet.js\"></script>
    <script type='text/javascript'>
    $(document).ready(function(){
    $(\".tweet\").tweet({
    username: \"sitepoint\",
    join_text: \"auto\",
    count: 1,
    auto_join_text_default: \"we said,\",
    auto_join_text_ed: \"we\",
    auto_join_text_ing: \"we were\",
    auto_join_text_reply: \"we replied to\",
    auto_join_text_url: \"we were checking out\",
    loading_text: \"loading tweets...\"
    });
    });
    </script>

    </head>

    <body>
    <div class=\"tweet\">
    <h4> latest tweets </h4>
    <!-- latest tweets here -->
    <a href=\"#\">follow us on twitter</a>
    </div>
    </body>
    </html>


    this is a screenshot http://img19.imageshack.us/img19/3889/37200970030am.png

    this is my code but i don`t know why ? when the plugin gets the tweets the anchor tag appears above it instead of under it ? so how can i solve this ?
  • the jQuery is probably appending it to the div #tweet, that means it appears after all the content in there already. See if there is a way to make it prepend.

    Have a look at these two links and you will see what I mean :)

    http://docs.jquery.com/Manipulation/append

    http://docs.jquery.com/Manipulation/prepend
  • thanks but i`m not very good with Javascripts or jquery i had troubles to make those small scripts work :D so i have managed to solve the problem by CSS by addind 2 extra divs one which holds the anchor tag and one to hold the 2 2 divs (tweets) & (the div conatcins the anchor tag) and with positioning i managed to make exactly how i wanted :)

    i have another question if u can help me with it will be great i want to use Cufon too and i have linked the it in the header and the font.js file too but how can i add the Cufon.replace in the script tag in the header with the other 2 scripts ??