/    Sign up×
Community /Pin to ProfileBookmark

Adjust Text Size – Load CSS File

Using PHP, is it possible to load different CSS files, upon different images being clicked?

Altogether, there will be 4 different text size settings, can the user can select, depending on how big the text needs to be, in order for the user to see correctly.

Upon each image being clicked, how do I load a different style sheet (CSS File)?

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@jabezJan 01.2008 — PHP is server sided, so you would have to refresh the whole page whenever the text size is changed.

You could try writing some javascript functions that would update the text sizes (or any other CSS properties for that matter) dynamically. When the user clicks on an image, the javascript function would be activated, to alter the CSS test sizes.

The other alternative would be using AJAX to retrieve a new CSS file, and then use javascript to load the contents of the new CSS file into the browser, updating the CSS text sizes like that.
×

Success!

Help @Dysan 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.19,
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,
)...