0

Across my application, I need to load a content block into a jQuery UI dialog. Each content block must be CSS-styled individually.

I can only think of two solutions, neither of which is ideal:

  • Use jQuery.load() to load a partial HTML page (i.e. no <head> or <body> tags) containing the content block inside the dialog. The external CSS file would then dynamically be appended using jQuery. The dialog can automatically resize to fit the content.
  • Use an iframe to load an entire page, which contains the content block and the external CSS references all in one page. But the dialog can't automatically resize.

Are there any better solutions?

2 Answers 2

4

Hi in that case you can put the style in the top of the page you are loading inside a style tag <style></style> instead of using css file

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

1 Comment

It isn't a perfect solution, but it's not a perfect world. Inline styles are the way to go here. Thanks.
0

you can add css properties to contents using jQuery css() also

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.