6

I have a button and I want to style it when disabled using inline style only.

I know how to style using internal/external style.

Code below:

<input type="submit" value="Submit" disabled="disabled" />
2
  • It's not possible, but you can add a <style></style>-block to add the CSS needed if you have control over the surrounding HTML. Commented May 20, 2016 at 13:01
  • 1
    @Emil, I know other ways but this. I wanted to know if it is possible using inline CSS anyhow. Commented May 20, 2016 at 17:44

1 Answer 1

2

Other than by explicitly changing the style with JavaScript (which violates your "inline CSS only" constraint): you can't.

The style attribute only contains the body of a rule-set. It can't do anything that you need a selector for.

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

1 Comment

sorry to say but i think this should be comment as op did not ask is it possible and you are saying that this is not possible.

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.