/    Sign up×
Community /Pin to ProfileBookmark

IS this possible with PHP, or should I use JS?

Hi there.
Happy n’year!

Is there a way in PHP to detect whether a visitor has CSS support – and if not, popup/echo a message to say so, as otherwise without CSS my site looks totally a mess!
Thanks.

to post a comment
PHP

6 Comments(s)

Copy linkTweet thisAlerts:
@AdamGundryJan 01.2004 — You can't do it AFAIK, but anyway you would be better off creating a standards-compliant site with correct markup, which would then display ok regardless of the browser. Visitors whose browsers do not support CSS will not be expecting beautiful graphics; if they do, they should upgrade.

Correct markup makes your site accessible to everyone regardless of browser; it may not look pretty, but it should work.

Adam

P.S. You can see what your pages look like without any graphics at all at http://www.delorie.com/web/lynxview.html
Copy linkTweet thisAlerts:
@TeachauthorJan 01.2004 — If you're referring to proper markup, my site validates as 1.1 xhtml strict, uses NO tables, and uses purely DIVS and CSS for layout, and minimal images =)
Copy linkTweet thisAlerts:
@AdamGundryJan 01.2004 — Then why does it look a mess without CSS?

Adam
Copy linkTweet thisAlerts:
@fredmvJan 01.2004 — If your markup made sense semantically it would look fine without CSS.
Copy linkTweet thisAlerts:
@TeachauthorJan 02.2004 — Hi there.

Indeed, the markup is fine and validates, and does look "ok" without CSS, what I meant was it doesn't look nice, but as has been posted, anyone without CSS won't be expecting a lovely website to view.

So you don't think it's poss to send an alert anyway ?
Copy linkTweet thisAlerts:
@AdamGundryJan 02.2004 — I suppose you could do this...

<div style="display:none">Your browser does not support CSS. Download <a href="http://www.mozilla.org/">Mozilla</a> today!</div>

Adam
×

Success!

Help @Teach 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 4.28,
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: @Yussuf4331,
tipped: article
amount: 1000 SATS,

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

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...