How to wrap two spans into one line with CSS

Tags: css,line,html

Problem :

I want to wrap two spans in one line with CSS.

Here is my code:

<div style="width:60px;">
    <span id="span1" style="float:left; display:inline;"></span>
    <span id="span2" style="float:left; display:inline; "></span>

But it doesn't work.

How to do that?


I want to use the "id", either use div or span, I just want them to be in one line.

When I just use span without style, the content are not in the same line. The second line will go down.

Solution :

<div style="float:left;">
<span style="display:inline;"></span>
<span style="display:inline; "></span>

    CSS Howto..

    HTML layout with vertical divider and menu between sections - how?

    How to override HTML with CSS

    CSS - How to make IE7 respect min-width

    How to style a randomly generated list of items in Javascript

    How to Apply css class on runTime

    How to display a tree in HTML/CSS? nested left-floating divs and wrapping

    How to add an image to an anchor tag using CSS?

    How to style checkbox using CSS?

    How can I change the entire background color of a page?

    How to include SASS into CSS

    How to Style Unique CSS Navigation Menu

    how to make a box of nxn given in a url?

    How to reference nested classes with css?

    How to add threshhold onclick() jQuery?

    Dialogs are showing at the bottom of the page

    How to determine if CSS has been loaded?

    How to make image previews (thumbnails) using html/css

    How to center banner with jquery mobile?

    How to format a button with in Form tag, html?

    How to give a nested HTML table cell a transparent background?

    How do you set the filepath for css in hiccup with Clojure using the html5 tag?

    How to have “onmouseover” highlight in css?

    How to float elements to the center in CSS?

    How to vertically align inline-block divs without vertical spaces using CSS?

    How to make the CSS “~” selector work in GWT Css Resource

    How to see the print media CSS in Firebug?

    How can i overlap inline divs?

    How to select li child of a ul without nth-child via css?

    How can I allign select menu with a button on the same line with css bootstrap?

    How do I make this lightbox I am creating only open on the div I am clicking?