Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to avoid content of span break in two lines?

Tags:

html

css

I have the following jsFiddle. When I resize the window the span is broken into two lines. How do I prevent that? I want the whole span to go to the second line.

<html>
    <body>
        <div id="dvContainer">
            <span style="border:1px;border-style:solid;margin-right:5px;padding:5px;">some text for the first span</span>
            <span style="border:1px;border-style:solid;margin-right:5px;padding:5px;">second text for second span</span>
        </div>
    </body>
</html>

edit:

I need them next to each other, but when I resize the screen I want the whole div to break the line, thanks

like image 667
RollRoll Avatar asked Nov 28 '22 16:11

RollRoll


1 Answers

You can use nowrap:

span{
  white-space: nowrap;
}
like image 100
Pavlo Shandro Avatar answered Dec 15 '22 18:12

Pavlo Shandro