/    Sign up×
Community /Pin to ProfileBookmark

Custom CSS in Jquery Mobile

Hello,

I used a Jquery Mobile Flipswitch on my webpage, but I want to change the default “On” “Off” text in it. I searched on the Jquery Mobile Demo paged and found this code:

[CODE]<form>
<label for=”flip-checkbox-2″>Flip toggle switch checkbox:</label>
<input type=”checkbox” data-role=”flipswitch” name=”flip-checkbox-2″ id=”flip-checkbox-2″ data-on-text=”Light” data-off-text=”Dark” data-wrapper-class=”custom-label-flipswitch”>
</form>[/CODE]

This works perfect, but they also say that I need to add an extra CSS style for it:

[CODE]/* Custom indentations are needed because the length of custom labels differs from
the length of the standard labels */
.custom-label-flipswitch.ui-flipswitch .ui-btn.ui-flipswitch-on {
text-indent: -3.4em;
}
.custom-label-flipswitch.ui-flipswitch .ui-flipswitch-off {
text-indent: 0.5em;
}[/CODE]

My question is: where do I have to write that extra CSS code into? I use the CDN Jquery file, so it’s not possible to add it there…

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@Kevin2Apr 26.2014 — If it's only on that one page you can put it in the <head> like so:
[code=html]<head>
<title>blah</title>
<style>
/* Custom indentations are needed because the length of custom labels differs from
the length of the standard labels */
.custom-label-flipswitch.ui-flipswitch .ui-btn.ui-flipswitch-on {
text-indent: -3.4em;
}
.custom-label-flipswitch.ui-flipswitch .ui-flipswitch-off {
text-indent: 0.5em;
}
</style>
</head>
<body>

......[/code]
Copy linkTweet thisAlerts:
@Argon007authorApr 27.2014 — Indeed, this works. But what if it's for multiple pages?

Can I do something like this:

[CODE]
<link href="my_own.css" rel="stylesheet" type="text/css">
<link href="http://code.jquery.com/mobile/1.4.2/jquery.mobile-1.4.2.min.css" rel="stylesheet" type="text/css">
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
<script src="http://code.jquery.com/mobile/1.4.2/jquery.mobile-1.4.2.min.js" type="text/javascript"></script>
[/CODE]
?
Copy linkTweet thisAlerts:
@Kevin2Apr 27.2014 — Yes
×

Success!

Help @Argon007 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...