0

coding a responsive site I want to implement a switch between a mobile version and a standard desktop version like the Wikipedia site does.

For this I should have to re-load the current HTML file but force it to use the CSS file for desktops although it is on a mobile screen such as an iPhone.

Is there any possibility to do so? I think Wikipedia uses PHP. But perhaps there is also a way with JS.

I would be very thankful for help. Thanks in advance.

4 Answers 4

1
@media handheld {
  #foo { position: static; }
}

http://www.w3schools.com/css/css_mediatypes.asp

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

Comments

0

I think with USER_AGENT you can find if the user is using the site using web or mobile. Detect the user agent look for some specific information and on the basis of that load different css

 $_SERVER['HTTP_USER_AGENT']; 

Comments

0

You could also use a php script that checks for the end device, loading a corresponding css file, or even a completely different html document. I worked from this script.

Comments

0
<style>
 @media screen
 {
   p {font-family:verdana} //an example with a paragraph
 }
 @media handeld
 {
   p {font-family:arial}  //an example with a paragraph
 }
</style>

This should work for both!! read up http://www.w3schools.com/css/css_mediatypes.asp

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.