Comment garder le format mobile sur pc et tablette

Fermé
WillBoxGaming Messages postés 17 Date d'inscription jeudi 6 juillet 2017 Statut Membre Dernière intervention 15 juillet 2017 - 6 juil. 2017 à 18:30
WillBoxGaming Messages postés 17 Date d'inscription jeudi 6 juillet 2017 Statut Membre Dernière intervention 15 juillet 2017 - 7 juil. 2017 à 12:15
bonjour, je code un site web en html\css et ma question est :
Comment garder le format mobile ( en tout temps) sur pc et sur tablette, car ma page tente de s'adapter de façon naturel et moi je veut qu'elle demeure en format mobile sur tous les platforme.
Au besoin je peut poster mon code.
Merci!
A voir également:

1 réponse

Dinath Messages postés 1602 Date d'inscription vendredi 12 avril 2013 Statut Contributeur sécurité Dernière intervention 6 novembre 2021 218
6 juil. 2017 à 21:51
Salut,

Tu dois avec un fichier CSS avec des @media dedans. Ce sont des médias queries, tu peux les lister ici ?
1
WillBoxGaming Messages postés 17 Date d'inscription jeudi 6 juillet 2017 Statut Membre Dernière intervention 15 juillet 2017 15
7 juil. 2017 à 12:15
Voila - c'est tout ce que j'ai.

<!DOCTYPE html>
<html>
<title>The YouTube Troll</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Oswald">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open Sans">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<style>
h1,h2,h3,h4,h5,h6 {font-family: "Oswald"}
body {font-family: "Open Sans"}
</style>
<body class="w3-light-grey">

<!-- w3-content defines a container for fixed size centered content, and is wrapped around the whole page content, except for the footer in this example -->
<!-- Top menu on small screens -->
<header class="w3-bar w3-top w3-hide-large w3-black w3-xlarge">
  <div class="w3-bar-item w3-padding-24 w3-wide">TYTT</div>
  <a href="javascript:void(0)" rel="nofollow noopener noreferrer" target="_blank" class="w3-bar-item w3-button w3-padding-24 w3-right" onclick="w3_open()"><i class="fa fa-bars"></i></a>
</header>

<!-- Overlay effect when opening sidebar on small screens -->
<div class="w3-overlay w3-hide-large" onclick="w3_close()" style="cursor:pointer" title="close side menu" id="myOverlay"></div>

<!-- !PAGE CONTENT! -->
<div class="w3-main" style="margin-left:2500px">

  <!-- Push down content on small screens -->
  <div class="w3-hide-large" style="margin-top:83px"></div>
  
   <!-- End page content -->
</div>
    </div>
  </div>
</div>
<!-- Sidebar/menu -->
<nav class="w3-sidebar w3-bar-block w3-white w3-collapse w3-top" style="z-index:3;width:250px" id="mySidebar">
  <div class="w3-container w3-display-container w3-padding-16">
    <i onclick="w3_close()" class="fa fa-remove w3-hide-large w3-button w3-display-topright"></i>
    <h3 class="w3-wide"><b>THE YOUTUBE TROLL</b></h3>
  </div>
  <div class="w3-padding-64 w3-large w3-text-grey" style="font-weight:bold">
      <a href="#" rel="nofollow noopener noreferrer" target="_blank" class="w3-bar-item w3-button w3-light-grey"><i class="fa fa-caret-right w3-margin-right"></i>HOME</a>
    <a href="http://youtube.ae.tn/changelog" rel="nofollow noopener noreferrer" target="_blank" class="w3-bar-item w3-button">CHANGELOG</a>
    <a onclick="myAccFunc()" href="javascript:void(0)" rel="nofollow noopener noreferrer" target="_blank" class="w3-button w3-block w3-white w3-left-align" id="myBtn">
      LANGUAGE <i class="fa fa-caret-down"></i>
    </a>
    <div id="demoAcc" class="w3-bar-block w3-hide w3-padding-large w3-medium">
      <a href="#" rel="nofollow noopener noreferrer" target="_blank" class="w3-bar-item w3-button w3-light-grey"><i class="fa fa-caret-right w3-margin-right"></i>ENGLISH</a>
      <a href="http://youtube.ae.tn/fr" rel="nofollow noopener noreferrer" target="_blank" class="w3-bar-item w3-button">FRANÇAIS</a>

  </div> 
</nav>



<script>
// Accordion 
function myAccFunc() {
    var x = document.getElementById("demoAcc");
    if (x.className.indexOf("w3-show") == -1) {
        x.className += " w3-show";
    } else {
        x.className = x.className.replace(" w3-show", "");
    }
}

// Script to open and close sidebar
function w3_open() {
    document.getElementById("mySidebar").style.display = "block";
    document.getElementById("myOverlay").style.display = "block";
}
 
function w3_close() {
    document.getElementById("mySidebar").style.display = "none";
    document.getElementById("myOverlay").style.display = "none";
}
</script>

  <!-- Header -->
  <header class="w3-container w3-center w3-padding-48 w3-white">
    <tr><td>
    <img src="https://pbs.twimg.com/media/DEAvBViXUAIWLjq?format=png" alt="The YouTube Troll Logo" style="width:100%" class="w3-padding-16">
    <h6>Trolling streamers had never been <span class="w3-tag">THAT EASY</span></h6>
  </header>

  
  </header>

  <!-- Grid -->
  <div class="w3-row w3-padding w3-border">

    <!-- Blog entries -->
    <div class="w3-col l8 s12">
    
      <!-- Blog entry -->
      <div class="w3-container w3-white w3-margin w3-padding-large">
        <div class="w3-center">
          <h3>The Porn Spamming Troll</h3>
        </div>

        <div class="w3-justify">
          <img src="https://pbs.twimg.com/media/DD9BT5WW0AAkNqf?format=jpg" alt="Porn Troll Picture" style="width:100%" class="w3-padding-16">
          <p><strong>The Porn Spamming Troll: </strong> This troll will appear to be a normal YouTube video, but it will spam the victim of delicious porn!</p>
          <p><strong>Scenario: </strong>15 seconds after the music starts, the page will close itself and spam the victim of porn, filled with loud orgasms.</p>
        </div>
          <p><button type="button" onclick="document.getElementById('porn').style.display='block'" class="w3-button w3-block w3-red">Use this troll</button></p>
        </div>
      </div>

    <!-- Blog entries -->
    <div class="w3-col l8 s12">
    
      <!-- Blog entry -->
      <div class="w3-container w3-white w3-margin w3-padding-large">
        <div class="w3-center">
          <h3>The 2Girls1Cup.com Spamming Troll</h3>
        </div>

        <div class="w3-justify">
          <img src="https://pbs.twimg.com/media/DD9DPHPWAAIhcoK?format=jpg" alt="2Girls1Cup Picture" style="width:100%" class="w3-padding-16">
          <p><strong>The 2Girls1Cup.com Spamming Troll: </strong> This troll will appear to be a normal YouTube video, but it will spam the victim with not so delicious porn this time...</p>
          <p><strong>Scenario: </strong>15 seconds after the music starts, the page will close itself and spam the victim with the famous website 2Girls1Cup.com. The victim will be automaticly redirected to the video so the people can see...</p>
        </div>
          <p><button type="button" onclick="document.getElementById('girl').style.display='block'" class="w3-button w3-block w3-red">Use this troll</button></p>
        </div>
      </div>

    <!-- Blog entries -->
    <div class="w3-col l8 s12">
    
      <!-- Blog entry -->
      <div class="w3-container w3-white w3-margin w3-padding-large">
        <div class="w3-center">
          <h3>The Knock Knock Troll</h3>
        </div>

        <div class="w3-justify">
          <img src="https://pbs.twimg.com/media/DD9EVFlXYAE61ph?format=jpg" alt="Knock Knock Troll Picture" style="width:100%" class="w3-padding-16">
          <p><strong>The Knock Knock Troll: </strong> This troll will appear to be a normal YouTube video, but there's ultra-realistic knock knock sounds that can seriousely freak out streamers. A nice troll to do that won't get the victim banned!</p>
          <p><strong>Scenario: </strong>15 seconds after the music starts, a knock knock sound will play indefinetly. The sound is embedded in the fake youtube page, so even if he pauses the video, the knock knock will continue looping.</p>
        </div>
          <p><button type="button" onclick="document.getElementById('knock').style.display='block'" class="w3-button w3-block w3-red">Use this troll</button></p>
        </div>
      </div>
    <!-- Blog entries -->
    <div class="w3-col l8 s12">
    
      <!-- Blog entry -->
      <div class="w3-container w3-white w3-margin w3-padding-large">
        <div class="w3-center">
          <h3>The Gore Spamming Troll</h3>
        </div>

        <div class="w3-justify">
          <img src="https://pbs.twimg.com/media/DD9E7AjW0AEidv0?format=jpg" alt="Gore Spamming Troll Picture" style="width:100%" class="w3-padding-16">
          <p><strong>The Gore Spamming Troll: </strong> This troll will appear to be a normal YouTube video, but it will spam the victim with attrocious gore crimes...</p>
          <p><strong>Scenario: </strong>15 seconds after the music starts, the page will close itself and spam the victim of videos like 3 Guys One Hammer, and so on.</p>
        </div>
          <p><button type="button" onclick="document.getElementById('gore').style.display='block'" class="w3-button w3-block w3-red">Use this troll</button></p>
        </div>
      </div>
              </div>
          </div>
        </div>
      </div>
      <hr>

  
      
    <!-- END BLOG ENTRIES -->
    </div>

    <!-- About/Information menu -->
    <div class="w3-col l4">
      <!-- About Card -->
        <div class="w3-container w3-black">
          <h4>DISCLAIMER</h4>
          <p>We are not responsible of any damage caused by this website, repercusions of the trolls or anything. Please use this website at your own risk. Thanks.</p>
    <div class="w3-col l4">
        </div>
      </div>
      <hr>

    <!-- END About/Intro Menu -->
    </div>

  <!-- END GRID -->
  </div>

<!-- END w3-content -->
</div>

<!-- Subscribe Modal -->
<div id="porn" class="w3-modal w3-animate-opacity">
  <div class="w3-modal-content" style="padding:32px">
    <div class="w3-container w3-white">
      <i onclick="document.getElementById('porn').style.display='none'" class="fa fa-remove w3-transparent w3-button w3-xlarge w3-right"></i>
      <h2 class="w3-wide">Have fun!</h2>
      <p>Please copy-paste the URL below and have fun trolling! (Don't forget to record)</p>
<table style="width:100%;">
    <tr>
        <td style="width:100%;">
            <input type="text" value="http://youtube.ae.tn/watchv-2Z4m4lnjxkY&t" style="width:100%;">
        </td>
    </tr>
</table>
      <button type="button" class="w3-button w3-block w3-padding-large w3-red w3-margin-bottom" onclick="document.getElementById('porn').style.display='none'">Okay</button>
    </div>
  </div>
</div>
<!-- Subscribe Modal -->
<div id="girl" class="w3-modal w3-animate-opacity">
  <div class="w3-modal-content" style="padding:32px">
    <div class="w3-container w3-white">
      <i onclick="document.getElementById('girl').style.display='none'" class="fa fa-remove w3-transparent w3-button w3-xlarge w3-right"></i>
      <h2 class="w3-wide">Have fun!</h2>
      <p>Please copy-paste the URL below and have fun trolling! (Don't forget to record)</p>
<table style="width:100%;">
    <tr>
        <td style="width:100%;">
            <input type="text" value="http://youtube.ae.tn/watchv-yw35BYhKVoo" style="width:100%;">
        </td>
    </tr>
</table>
      <button type="button" class="w3-button w3-block w3-padding-large w3-red w3-margin-bottom" onclick="document.getElementById('girl').style.display='none'">Okay</button>
    </div>
  </div>
</div>
<!-- Subscribe Modal -->
<div id="knock" class="w3-modal w3-animate-opacity">
  <div class="w3-modal-content" style="padding:32px">
    <div class="w3-container w3-white">
      <i onclick="document.getElementById('knock').style.display='none'" class="fa fa-remove w3-transparent w3-button w3-xlarge w3-right"></i>
      <h2 class="w3-wide">Have fun!</h2>
      <p>Please copy-paste the URL below and have fun trolling! (Don't forget to record)</p>
<table style="width:100%;">
    <tr>
        <td style="width:100%;">
            <input type="text" value="http://youtube.ae.tn/watchv-QH2-TGUlwu4&" style="width:100%;">
        </td>
    </tr>
</table>
      <button type="button" class="w3-button w3-block w3-padding-large w3-red w3-margin-bottom" onclick="document.getElementById('knock').style.display='none'">Okay</button>
    </div>
  </div>
</div>
<!-- Subscribe Modal -->
<div id="gore" class="w3-modal w3-animate-opacity">
  <div class="w3-modal-content" style="padding:32px">
    <div class="w3-container w3-white">
      <i onclick="document.getElementById('gore').style.display='none'" class="fa fa-remove w3-transparent w3-button w3-xlarge w3-right"></i>
      <h2 class="w3-wide">Have fun!</h2>
      <p>Please copy-paste the URL below and have fun trolling! (Don't forget to record)</p>
<table style="width:100%;">
    <tr>
        <td style="width:100%;">
            <input type="text" value="http://youtube.ae.tn/watchv-mWFL-3PbV5U&" style="width:100%;">
        </td>
    </tr>
</table>
      <button type="button" class="w3-button w3-block w3-padding-large w3-red w3-margin-bottom" onclick="document.getElementById('gore').style.display='none'">Okay</button>
    </div>
  </div>
</div>
<!-- Footer -->
<footer class="w3-container w3-black" style="padding:32px">
  <a href="#" rel="nofollow noopener noreferrer" target="_blank" class="w3-button w3-dark-grey w3-padding-large w3-margin-bottom"><i class="fa fa-arrow-up w3-margin-right"></i>To the top</a>
</footer>

</body>
</html>
0