Hello. I´m new to css and is this my second topic on this forum. I´m currently redesigning a site using css instead of tables. On this site I now have several Divs defined in a style sheet and linking to them from my php document. So far so good but the image below explains what I want: Here´s the div: #MainTop_b { position: relativ; width: 320px; height:183px; margin-left: 0px; margin-top: 0px; font-weight: normal; padding-top:15px; padding-left:15px; padding-right:15px; float:left } Code (markup): And here´s the document: <DIV id="MainTop_b"><span class="Heading">Top Stories</span> <ul id="listimage"> <li id="active"><a href="#"><em>An ancient legacy</em></a></li> <li><span class="style1"><a href="#">The signs are everywhere</a></span></li> <li><em><a href="#">What lies within our DNA?</a></em></li> <li><em><a href="#">The alien technology</a></em></li> <li><em><a href="#">The nascan conundrum</a></em></li> </DIV> Code (markup): And last here´s the code generating the facobook icon wich I´d like to display in top right corner of the div. <a name="fb_share" type="button_count" href="http://www.facebook.com/sharer.php">Share</a> Code (markup): I´ve been trying different things but my innexperience is just messing it up. Can someone please help me with this? I´m not allowed to post live links yet since I´m a new member. Sincerely Ronny
Set #MainTop_b to position: relative; Then, set your facebook button to position: absolute; top: 0; right: 0; That should work.
I see... Thanks. Do I nead to create a new specific div for this in the style sheet or is there a way I could define this in the document? Tryed with a div definition in the style sheet... Didn´t work. It ligned up next to the Heading. Allso the icon didnt show. Only the "share" link.
I assume it's ok to put a class in the anchor without messing up facebook script. <a class="facebook" name="fb_share" type="button_count" href="http://www.facebook.com/sharer.php">Share</a> .facebook { float: right; } Code (markup): BTW, you have left an "e" off the end of position: relativ;
Thanks guys... I did put the facebook icon within the TopMain_b. However the solutin with the class before the facebook code worked. Still no image though. Just the "share" link. But I´m getting there
Do you have the share script right after it? <a class="facebook" name="fb_share" type="button_count" href="http://www.facebook.com/sharer.php">Share</a> <script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script> Code (markup):