Sebastian Starke
Sebastian Starke

Reputation: 5317

spans change place with CSS

I know, that HTML is HTML and CSS is CSS, so please no answers like: You should do that in another way. I want two spans to change place. I don't want to hack this Wordpress plugin, so I want to do it with js (I know how to do that) or even better, with CSS.

This is the code:

<span class="count">(0)</span><span class="label">Recommend</span>

They look like this now:

(0) Recommend

And I want them to look that way:

Recommend (0)

Is that possible with pure CSS? I could imagine something with absolute positioning.

Upvotes: 1

Views: 1522

Answers (2)

Rohit Azad Malik
Rohit Azad Malik

Reputation: 32162

yes do this

Used to this css

.count{float:right;}
.label{float:left;}

do not make the position:absolute;

Upvotes: 1

Swarnamayee Mallia
Swarnamayee Mallia

Reputation: 2008

First of all you can change the position of the both of the span like below Recommend(0)

                    **OR**

Keep your own code without changing the position of span in your code just put the following css in your respective css file. Demolink Recommend (0)

.count {
   display:inline-block;
}
.label {
    float:left;
}

Upvotes: 1

Related Questions