tags:

views:

42

answers:

2

Hi,

I don't know much about web app dev, and I want to make make a div always showing on the left most side of the browser window, like the red 'feedback' of user voice, would you give me some hints? thanks!

+4  A: 

Try this:

div#mydiv {
    position: fixed;
    left: 0;
}

You'll probably want to add top or bottom to that as well so that it doesn't sit at the top of the screen.

Something like:

div#mydiv {
    position: fixed;
    left: 0;
    top: 200px; /* 200px from top */
}

or:

div#mydiv {
    position: fixed;
    left: 0;
    bottom: 200px; /* 200px from bottom */
}

or:

div#mydiv {
    position: fixed;
    left: 0;
    top: 50%; /* Half way down the side */
}
Graphain
`fixed` would be better.
casablanca
@casablance - Yes you are right, amended.
Graphain
Thanks! I'll try it later and will accept the answer accordingly!
Edwin
+2  A: 

set its position to fixed and its left to 0px

#fixedLeft{
    position:fixed; /* now it will stay fixed on the screen, even while you scroll*/
    left:0px; /* it will be stuck to the left*/
    top:50%; /* it will be in the middle (vertically)*/
}
Gaby
Thanks Gaby! Two answers are similar :)
Edwin