Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6601233
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T18:43:35+00:00 2026-05-25T18:43:35+00:00

I have a main.htm file with its own css references. I want to open

  • 0

I have a main.htm file with its own css references. I want to open a jQuery UI dialog when user clicks a button on main.htm. There is a .js file (referenced in main.htm) which handles this process.
My question is: how can I have the dialog with jQuery UI style but without adding any css file in main.htm? Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T18:43:35+00:00Added an answer on May 25, 2026 at 6:43 pm

    I’m not entirely sure what you’re trying to accomplish. It might help to explain your goal. You’re going to need some CSS one way or another to achieve styling. It seems you’re caught on the best way to inject this styling into your document dynamically – true?

    1. If you’re using jQuery UI at all, then you should have the jQuery ui css file included in whatever HTML document you’re using. If for whatever reason, it’s not available when the button is clicked (say you’re trying to reduce requests…), you can programmatically append the <link rel="href" type="stylesheet" href="..." /> with jQuery via jQuery('head').append('<link>',{ ...attrs ... });

    2. If you already have jQuery ui, but want a particular dialog to have a different styling than the rest of your dialogs, jQuery ui has a built in facility for this in Themeroller via the CSS scope parameter (available within the advanced theme settings on the jQuery ui download page)


    I noticed your concerned about modifying main.html – possibly because you don’t want the jQuery ui styles affecting the rest of your site. You should be okay: the jQuery ui stylesheets are extremely specific, they’re not going to make global changes to styling on your site i.e. affect the body font.

    You can further prevent any conflicts (likely to only occur if the main.html starts using it’s own jQuery ui) by using the optional namespace during themeroller export – If conflicts are your primary concern and reason for avoiding appending to main.html.

    Using an IFRAME is going to have it’s own problems: such as confining the dragging of the ui dialog to within the iframe – potentially rendering it useless. You might be able to hack together something where the iframe housing the ui dialog is absolutely repositioned as you move the dialog inside.

    You’re better off challenging the restriction on modifying main.html vs. working around it with a hack. The tradeoff between maybe, in a blue moon, breaking the clients styling vs. just having a really busted jQuery ui dialog dancing around in an absolutely positioned iframe is not worth it IMO.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have main categories and sub categories. I want to be able to sort
I have a main window (#1) on my webpage from which I open a
I have my main GUI thread, and a second thread running inside it's own
I have main config file /app/config.yml . Now i have services.yml in myBundle/resources/config/services.yml Do
i want to have a link in frame a and open in frame b
I'm using a webview on my activity. page is loaded from android_asset: webView.loadUrl(file:///android_asset/htm/main.htm); I
I have main table called 'Employee' and another slave table called 'EmployeeTypes' that has
i have a table called category in which i have main category ids and
I have 2 classes within same package. Both classes have main method in them.
I have a main asp.net app, which is written in asp.net 1.1. Runnning underneath

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.