Search code examples
csspositionwidthfixed

CSS position fixed property error


This is my website : http://www.kursatkarabulut.com/dersler/

I'm trying to make the like buttons stay on a fixed position on top left of the browser. Each like button is in another child class of .likebuttons. What is wrong with this CSS?

My CSS is :

.likebuttons {
    position:fixed;
    left:5px;
    top:5px;
    margin:20px 25px 0;
} 

Also I have another question. Page width is 800px. When I open this page in Explorer/Opera/Safari/Mozilla It all seems normal. But when I open it in Chrome, it ignores width:800px; and margin:0 auto; to become full screen wide. How can I fix this?

My HTML is:

body {
    width:800px;
    margin:0 auto;
    height:100%;
    text-align:justify;
    padding: auto;
    background:#CCCCCC;
    margin-bottom:15px;
}

Solution

  • This is what you have :

    .likebuttons {
        display: block;
        position: absolute;
        left: 0px;
        top: 100px;
        width: 300px;
        height: 200px;
        margin: 20px 25px 0;
        clear: right;
    }
    

    Change top: 100px; to top: 0px;

    Works normal in chrome.