Partage
  • Partager sur Facebook
  • Partager sur Twitter

Media queries qui ne s'appliquent pas

    28 mai 2017 à 17:17:16

    Bonjour, je tente de créer un site web pour un prelunch page. Donc, j'aimerais affiché un arrière plan lorsque le visiteur a une largeur de page de 1400px. Mais, le media ci-affiché ne s'affiche pas. Que fais-je de mal ?

    Le code du media : 

    @media (min-width: 1400px)
    {
         body
     {
            background: url("img/bg3.jpg") center top 100% 100%;
     }
     .body h1
     {
        font-size: 35px;
     }
     .body, form
     {
        width: 550px;
     }
    .input
    {
        width: 450px;
    }
    }

    Le site web :

    www.warehouseapparel.com

    Je test mon site avec screenfly.com

    html total :

    <!DOCTYPE html>
    <html>
    <head>
    	<title>Warehouse Apparel | We are coming soon !</title>
    	<link rel="stylesheet" type="text/css" href="css.css">
    <link href="https://fonts.googleapis.com/css?family=Roboto:300,700" rel="stylesheet">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name=viewport content="width=device-width, initial-scale=1">
      <meta name="description" content="Free shipping worldwide and best price directly from the supplier Warehouse.">
      <meta name="keywords" content="Warehouse, apparel, free, shipping, worldwide, outlet, clothing, cheap, best, pice">
    
    </head>
    <body>
    	<div class="header">
    		<a href="index.php" title="Warehouse Apparel"><img src="img/logo.png" alt="Logo of Warehouse Apparel" title="Warehouse Apparel" /></a>
    
    	</div>
    
    	<div class="body">
    		<h1>Imagine a world</h1>
    		<h1>Where Fashion is afordable.</h1>
    		<h2>Welcome on <strong>Warehouse Apparel.</strong></h2>
    		<p>We are coming soon !  Be the first to know. Let us keep you in touch when will be online and receive a 20% discount on your first purchase.</p>
    <?php
    if (isset($_GET['e']) && $_GET['e'] == 2 || isset($_GET['e']) && $_GET['e'] == 3 || isset($_GET['e']) && $_GET['e'] == 1) {
    	echo "<p class=\"wrong\">Please fullfill a valid e-mail.</p>";
    }
    elseif (isset($_GET['e']) && $_GET['e'] == 4) {
    	echo "<p class=\"good\">Thank you! Watch your e-mail and you should receive your discount when we lunch. </p>";
    }
    			
    
    ?>
    		<form method="post" action="action.php">
    			<input class="input" type="email" name="email" placeholder="Enter your E-mail adress" /><!--whitespace
    			--><input class="sub" type="submit" name="submit" value="Subscribe"/>
    
    		</form>		
    
    <p class="right">By suscribing, you consent to receive e-mails from us.</p>
    	</div>
    
    <div class="footer">
    	
    <p>Copyright 2017 - Warehouse Apparel. All rights reserved.</p>
    <p>For any inquiries, please <a href="mailto:contact@Warehouseapparel.com" title="contact us">Contact us</a>.</p>
    
    </div>
    
    
    </body>
    </html>

    css total :
    html, body, div, span, applet, object, iframe,
    h1, h2, h3, h4, h5, h6, p, blockquote, pre,
    a, abbr, acronym, address, big, cite, code,
    del, dfn, em, img, ins, kbd, q, s, samp,
    small, strike, strong, sub, sup, tt, var,
    b, u, i, center,
    dl, dt, dd, ol, ul, li,
    fieldset, form, label, legend,
    table, caption, tbody, tfoot, thead, tr, th, td,
    article, aside, canvas, details, embed, 
    figure, figcaption, footer, header, hgroup, 
    menu, nav, output, ruby, section, summary,
    time, mark, audio, video {
    	margin: 0;
    	padding: 0;
    	border: 0;
    	font-size: 100%;
    	font: inherit;
    	vertical-align: baseline;
    }
    /* HTML5 display-role reset for older browsers */
    article, aside, details, figcaption, figure, 
    }
    body {
    	line-height: 1;
    }
    ol, ul {
    	list-style: none;
    }
    footer, header, hgroup, menu, nav, section {
    	display: block;
    }
    blockquote, q {
    	quotes: none;
    }
    blockquote:before, blockquote:after,
    q:before, q:after {
    	content: '';
    	content: none;
    }
    table {
    	border-collapse: collapse;
    	border-spacing: 0;
    }
    
    
    body
    {
    	font-family: 'Roboto', sans-serif;
    	background: url("img/bg1.jpg") center top;
    	padding: 0;
    	margin:0;
    }
    
    .header
    {
    	background: white;
    	width: auto;
    	height: 100px;
    	line-height: 100px;
    	box-shadow: 0px 1px 3px black;
    }
    .header img
    {
    	vertical-align: middle;
    	margin-left: 200px;
    }
    
    .body
    {
    	width: 500px;
    	position: absolute;
    	right: 50px;
      top: 50%; /* poussé de la moitié de hauteur du référent */
      transform: translateY(-50%);
    	color: white;
    
    }
    .body h1
    {
    	text-transform: uppercase;
    	font-weight: 700;
    	font-size: 32px;
    }
    .body h2
    {
    	text-transform: uppercase;
    	font-weight: 700;
    	font-size: 25px;
    }
    .body p
    {
    	font-size: 14px;
    	font-weight: 300;
    	margin: 10px 0;
    }
    strong
    {
    	color: #2c3e50;
    }
    form
    {
    	height: 35px;
    	border: 3px solid #2c3e50;
    	padding: 0;
    	width: 500px;
    }
    input
    {
    	height: 29px;
    		text-transform: uppercase;
    	color: grey;
    
    }
    input:focus
    {
    	outline: none;
    }
    .input
    {
    	width: 400px;
    	
    
    }
    .sub
    {
    	width: 96px;
    	background-color: #2c3e50;
    	color: white;
    	font-weight: 700;
    	border: 0;
    	height: 35px;
    	cursor: pointer;
    }
    .sub:hover
    {
    	background-color: #47b9dd;
    	transition: 0.5s;
    }
    .body .wrong
    {
    	font-weight: 700;
    	color: white;
    	font-family: 'Roboto', sans-serif;
    	color: red;
    }
    .body .good
    {
    	font-weight: 700;
    	color: white;
    	font-family: 'Roboto', sans-serif;
    	color: white;
    }
    .footer
    {
    	position: absolute;
    	bottom: 0;
    	left: 0;
    	right: 0;
    	padding: 10px;
    	text-align: right;
    	
    	color: black;
    
    
    }
    .footer p
    {
    	display: inline-block;
    	font-size: 12px;
    
    
    }
    a
    {
    	text-decoration: none;
    	color: black;
    	font-weight: 700;
    }
    .body .right
    {
    	text-align: right;
    	font-size: 10px;
    }
    @media (max-width: 1069px) {
     body
     {
     		background: url("img/bg2.jpg") center top 100% 100%;
     }
     .body h1
     {
     	font-size: 25px;
     }
     .body, form
     {
     	width: 450px;
     }
    .input
    {
    	width: 350px;
    }
    }
    @media (min-width: 1000px)
    {
    	 body
     {
     		background: url("img/bg3.jpg") center top 100% 100%;
     }
     .body h1
     {
     	font-size: 35px;
     }
     .body, form
     {
     	width: 550px;
     }
    .input
    {
    	width: 450px;
    }
    }
    
    
    
    
    
    

    -
    Edité par NoNames 28 mai 2017 à 17:47:28

    • Partager sur Facebook
    • Partager sur Twitter
    D'la neige, d'la neige partout

    Media queries qui ne s'appliquent pas

    × Après avoir cliqué sur "Répondre" vous serez invité à vous connecter pour que votre message soit publié.
    × Attention, ce sujet est très ancien. Le déterrer n'est pas forcément approprié. Nous te conseillons de créer un nouveau sujet pour poser ta question.
    • Editeur
    • Markdown