0
input[type="radio"][class="selectorPrev"]:hover+ label:before {
content:'Previous image';
z-index:999;
position:relative;
}

Is it possible to apply margin-left:10px only on the content propertie and leave all the res the same? How to do this?

1
  • 1
    why not use .selectorPrev for class? Commented Jan 16, 2013 at 15:36

1 Answer 1

1

Yes, but you need to specify the pseudo element to be a block or inline-block first, as it is generated as an inline element and, therefor, cannot have a margin.

input[type="radio"][class="selectorPrev"]:hover + label:before {
  content:'Previous image';
  display:inline-block;
  position:relative;
  z-index:999;
  margin-left:10px;
}
Sign up to request clarification or add additional context in comments.

3 Comments

This doesn't work. It moves the whole input element to the left. I only want to move the content sign.
No it doesn't, at least not with what you've given us. Perhaps you have other styles that are conflicting? Here's a jsfiddle showing you the difference: jsfiddle.net/rgthree/97Q2W
Thanks for the sollution. But as I was searching for more info, I found that the content propertie is not advised for displaying info content. I used a different soollution. Many thanks anyway.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.