0

Is something like this possible?

.imgbox:hover{ .ui-resizable-se { /*some style */ } }

Or a conceptual equivalent? Basically, only when an element of a certain class is hovered over, then some element within that class should change some style.

2
  • No. Not without SASS or LESS. Commented Feb 10, 2013 at 12:18
  • 3
    .imgbox:hover .ui-resizable-se { /*some style */ } Ignore the less/sass answers - they misunderstand the extremely simply problem and shoot canon balls at your fly. Not saying anything against sass/less, but whether to use that or not is a WHOLE other issue. Commented Feb 10, 2013 at 12:19

4 Answers 4

3

You can do this:

.imgbox:hover .ui-resizable-se { /*some style */ }

The same can be generated by LESS or SASS.

Sign up to request clarification or add additional context in comments.

Comments

2

Sure that would be :

.imgbox:hover .ui-resizable-se { /*some style */ } 

Comments

1

No, CSS does not allow nesting. You'd have to write it like this:

.imgbox:hover .ui-resizable-se { /*some style */ }

However, there are various CSS preprocessors available which convert something like this in valid CSS. The most popular ones are LESS and SASS/SCSS.

Comments

1

Not with plain CSS but you can with a CSS preprocessor like Sass:

http://sass-lang.com/

table.hl {
  margin: 2em 0;
  td.ln {
    text-align: right;
  }
}

li {
  font: {
    family: serif;
    weight: bold;
    size: 1.2em;
  }
}

Generates:

/* CSS */

table.hl {
  margin: 2em 0;
}
table.hl td.ln {
  text-align: right;
}

li {
  font-family: serif;
  font-weight: bold;
  font-size: 1.2em;
}

Comments

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.