I want to create a span with a fixed width that when I type any thing in the span like lgasdfjksdajgdsglkgsadfasdfadfasdfadsfasdfasddkgjk
lgasdfjksdajgdsglkgsadfasdfadfasdfadsfasdfasddkgjk
Try following css with addition of white-space:
white-space
span { display: block; word-wrap:break-word; width: 50px; white-space: normal }