Click here to Skip to main content
15,890,947 members
Please Sign up or sign in to vote.
2.00/5 (2 votes)
See more:
the facebook link does not fixed in center page of the browsers only in IE6.....

here is my code:::::::
XML
<table width="100%" border="0" cellspacing="0" cellpadding="0">
                           <tr>
                               <td align="center" valign="top">
                                   <div style="position: absolute; right: 0px; float: right; width: 0px;">
                                       <div class="sociallink">
                                           <a href="www.facebook.com">
                                               <img src="image/facebook.png" /></a><br />
                                           <a href="wwww.twitter.com">
                                               <img src="image/twitter.png" /></a><br />
                                           <a href="www.blog.com">
                                               <img src="image/blog.png" /></a>
                                       </div>
                                   </div>
                               </td>
                           </tr>
                       </table>


and my css page coding here
C#
.sociallink
{
    position: fixed;
    top: 200px;
    right: 0px;
    background: url('../image/social_bg.png') no-repeat;
    padding: 35px 0px 5px 12px;
    height: 175px;
    margin-top: 10px;
}



please give me a solution
Posted
Comments
Ed Nutting 21-Feb-12 12:38pm    
Please clarify your question - your HTML/CSS looks poor and messy at the moment if I'm honest - for instance why have you put float: right; on a div that is position: absolute;!? float should make no difference to a position: absolute; element! You need to say what you were trying to do, why and how - explain what your HTML/CSS does - line-by-line.

Please improve the question so that I can answer it as I do know a fair bit about HTML/CSS but I don't know what you are trying to do at the moment and hence I don't know what is going wrong.
Ed

1 solution

For a quick solution to your problem of placing things in the centre of a web page (without using tables - tables are "ugh!" - div's are so much better for this sort of thing!):

HTML
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
.CenterWrapper
{
    position:fixed;
    /*Use the "top" style here to set how far up/down the page you want - setting it to greater than 600px will result in many people never being able to see it due to the use of position: fixed; but that seemed to be what you wanted...*/
    top:100px;
    left:0px;
    /*width:100% so that the container is centering stuff for the whole page*/
    width:100%;
    margin:0px;
    padding:0px;
    height:auto;
    /*Makes the box inside centred*/
    text-align:center;
}
/*Used to wrap all your content so that all content is centred as a whole*/
.CenterInnerWrapper
{
    /*Resizes the box to the size of then content so that content is centred correctly*/
    width:auto;
    /*Makes the div display inline (but still as a block) so that the text-align property of parent element applies.*/
    display:inline-block;
    height:auto;
    position:relative;
}
.sociallink
{
    background: url('../image/social_bg.png') no-repeat;
    padding:0px;
    /*Use this to change the height of your centred box - i.e. the size of the images*/
    height: 175px;
    width:auto;
}
/*Makes the images resize to the size of the box - remove this to make images display at their original size - if you do so, set the height property of .sociallink to auto!*/
.sociallink img
{
    width:auto;
    height:100%;
}
</style>
</head>

<body>

<div class="CenterWrapper">
    <div class="CenterInnerWrapper">
           <div class="sociallink">
               <a href="www.facebook.com">
                   <img src="http://scienceroll.files.wordpress.com/2009/12/facebook2009-04-21-1240343633.jpg" /></a><br />
               <a href="wwww.twitter.com">
                   <img src="http://cdn.caughtoffside.com/wp-content/uploads/2011/05/twitter_logo_12.jpeg" /></a><br />
               <a href="www.blog.com">
                   <img src="http://1.bp.blogspot.com/_hsWThc1UE9o/TK7kodO8XcI/AAAAAAAAP1Y/hCOjfnJSAII/s1600/blog.jpg" /></a>
           </div>
     </div>
</div>

</body>



Hope this helps, don't forget to change your image URL's back to what they were,
Ed

Updated CSS comments - I accidently used "//" instead of "/*MYCOMMENT*/" - this has been rectified
 
Share this answer
 
v2
Comments
vivekx2 23-Feb-12 2:38am    
Thanks for ur help....But not working in IE6.....IN IE6 the image link shows only at bottom of the page.....can u give more comments for this problem to solve,...........

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900