2

When I add Jquery mobile to my HTML using CDN;

<link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.css" />
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.js"></script>

It completely takes over my styles & breaks my design.

Is there anything I can do so that way its not using Jquery's CSS for my whole project?

5
  • We need more of your code to answer the question. But do you include your own styles before or after the jQuery mobile styles? If you do try to include your own styles last. This very easy to forget, I know because I do it myself, a lot... Commented Nov 21, 2014 at 17:27
  • is it necessary to include the standard jquery? Commented Nov 21, 2014 at 17:30
  • Well I'm only adding jquery for one particular feature, a popup menu for a Settings button in my web-app. I don't want it to override my current styles for text areas and buttons. It even changes my background. Commented Nov 21, 2014 at 17:33
  • Create your own popup rather than adding JQM just for one widget. JQM is a framework, it will change your website entirely. Commented Nov 21, 2014 at 17:40
  • The most conflicting one in any css framework will be box-sizing: padding-box. I think you are not applying this style. Make this inheriting property to go by overriding with box-sizing: content-box. Commented Dec 13, 2015 at 4:26

2 Answers 2

2

The jquery.mobile.css has a lot of classes and attributes that can be in conflict with your classes puting properties diferents that properties that you are expect for each tag or class.

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

Comments

0

According to my experience including jquery.mobile.css alone is harmless, the trouble comes when the - mostly unnecessary - jquery.mobile scripts are loaded. The solution was using only those functions that are required, in my case 8k vs 200k and the problem was gone.

More details here (since I can't comment):

jQuery Mobile breaks links. What is the correct use?

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.