2016-02-04 10 views
5

मैं मैं एक पृष्ठभूमि छवि बूटस्ट्रैप का उपयोग कर की तरह ही Endomodo's siteका उपयोग कर बूटस्ट्रैप

साथ एक div फुलस्क्रीन हो सकता है जहां एक पृष्ठ बनाना चाहते हैं एक bakcground छवि के साथ एक div फुलस्क्रीन बनाने के लिए के बाद से मैं सिर्फ बूटस्ट्रैप शुरू मैं कुछ नमूने डाउनलोड किया startboostrap website पर और जो मैं चाहता हूं उसे प्रबंधित करने की कोशिश की। मेरी समस्या यह है कि मेनू और सामग्री पृष्ठ में दिखायी जाती है लेकिन मेरा div (और इसलिए छवि) नहीं है। मेरे HTML/CSS:

body { 
 
    margin-top: 50px; /* Required margin for .navbar-fixed-top. Remove if using .navbar-static-top. Change if height of navigation changes. */ 
 
} 
 

 
/* Header Image Background - Change the URL below to your image path (example: ../images/background.jpg) */ 
 

 
.full { 
 
    background: url(bg3.jpg) no-repeat center center fixed; 
 
    -webkit-background-size: cover; 
 
    -moz-background-size: cover; 
 
    background-size: cover; 
 
    -o-background-size: cover; 
 
} 
 

 
.header-image { 
 
    display: block; 
 
    width: 100%; 
 
    text-align: center; 
 
    background: url('http://placehold.it/1900x500') no-repeat center center scroll; 
 
    -webkit-background-size: cover; 
 
    -moz-background-size: cover; 
 
    background-size: cover; 
 
    -o-background-size: cover; 
 
} 
 

 
.headline { 
 
    padding: 120px 0; 
 
} 
 

 
.headline h1 { 
 
    font-size: 130px; 
 
    background: #fff; 
 
    background: rgba(255,255,255,0.9); 
 
} 
 

 
.headline h2 { 
 
    font-size: 77px; 
 
    background: #fff; 
 
    background: rgba(255,255,255,0.9); 
 
} 
 

 
.featurette-divider { 
 
    margin: 80px 0; 
 
} 
 

 
.featurette { 
 
    overflow: hidden; 
 
} 
 

 
.featurette-image.pull-left { 
 
    margin-right: 40px; 
 
} 
 

 
.featurette-image.pull-right { 
 
    margin-left: 40px; 
 
} 
 

 
.featurette-heading { 
 
    font-size: 50px; 
 
} 
 

 
footer { 
 
    margin: 50px 0; 
 
} 
 

 
@media(max-width:1200px) { 
 
    .headline h1 { 
 
     font-size: 140px; 
 
    } 
 

 
    .headline h2 { 
 
     font-size: 63px; 
 
    } 
 

 
    .featurette-divider { 
 
     margin: 50px 0; 
 
    } 
 

 
    .featurette-image.pull-left { 
 
     margin-right: 20px; 
 
    } 
 

 
    .featurette-image.pull-right { 
 
     margin-left: 20px; 
 
    } 
 

 
    .featurette-heading { 
 
     font-size: 35px; 
 
    } 
 
} 
 

 
@media(max-width:991px) { 
 
    .headline h1 { 
 
     font-size: 105px; 
 
    } 
 

 
    .headline h2 { 
 
     font-size: 50px; 
 
    } 
 

 
    .featurette-divider { 
 
     margin: 40px 0; 
 
    } 
 

 
    .featurette-image { 
 
     max-width: 50%; 
 
    } 
 

 
    .featurette-image.pull-left { 
 
     margin-right: 10px; 
 
    } 
 

 
    .featurette-image.pull-right { 
 
     margin-left: 10px; 
 
    } 
 

 
    .featurette-heading { 
 
     font-size: 30px; 
 
    } 
 
} 
 

 
@media(max-width:768px) { 
 
    .container { 
 
     margin: 0 15px; 
 
    } 
 

 
    .featurette-divider { 
 
     margin: 40px 0; 
 
    } 
 

 
    .featurette-heading { 
 
     font-size: 25px; 
 
    } 
 
} 
 

 
@media(max-width:668px) { 
 
    .headline h1 { 
 
     font-size: 70px; 
 
    } 
 

 
    .headline h2 { 
 
     font-size: 32px; 
 
    } 
 

 
    .featurette-divider { 
 
     margin: 30px 0; 
 
    } 
 
} 
 

 
@media(max-width:640px) { 
 
    .headline { 
 
     padding: 75px 0 25px 0; 
 
    } 
 

 
    .headline h1 { 
 
     font-size: 60px; 
 
    } 
 

 
    .headline h2 { 
 
     font-size: 30px; 
 
    } 
 
} 
 

 
@media(max-width:375px) { 
 
    .featurette-divider { 
 
     margin: 10px 0; 
 
    } 
 

 
    .featurette-image { 
 
     max-width: 100%; 
 
    } 
 

 
    .featurette-image.pull-left { 
 
     margin-right: 0; 
 
     margin-bottom: 10px; 
 
    } 
 

 
    .featurette-image.pull-right { 
 
     margin-bottom: 10px; 
 
     margin-left: 0; 
 
    } 
 
}
<!DOCTYPE html> 
 
<html lang="en"> 
 
<!-- Make sure the <html> tag is set to the .full CSS class. Change the background image in the full.css file. --> 
 

 
<head> 
 

 
    <meta charset="utf-8"> 
 
    <meta http-equiv="X-UA-Compatible" content="IE=edge"> 
 
    <meta name="viewport" content="width=device-width, initial-scale=1"> 
 
    <meta name="description" content=""> 
 
    <meta name="author" content=""> 
 

 
    <title>Full - Start Bootstrap Template</title> 
 
    
 
    <!-- Latest compiled and minified CSS --> 
 
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous"> 
 

 
    <!-- Bootstrap Core CSS --> 
 
    <link href="css/bootstrap.min.css" rel="stylesheet"> 
 

 
    <!-- Custom CSS --> 
 
    <link href="css/full.css" rel="stylesheet"> 
 

 
    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> 
 
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> 
 
    <!--[if lt IE 9]> 
 
     <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script> 
 
     <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script> 
 
    <![endif]--> 
 

 
</head> 
 

 
<body> 
 

 
    <!-- Navigation --> 
 
    <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation"> 
 
     <div class="container"> 
 
      <!-- Brand and toggle get grouped for better mobile display --> 
 
      <div class="navbar-header"> 
 
       <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"> 
 
        <span class="sr-only">Toggle navigation</span> 
 
        <span class="icon-bar"></span> 
 
        <span class="icon-bar"></span> 
 
        <span class="icon-bar"></span> 
 
       </button> 
 
       <a class="navbar-brand" href="#">Start Bootstrap</a> 
 
      </div> 
 
      <!-- Collect the nav links, forms, and other content for toggling --> 
 
      <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> 
 
       <ul class="nav navbar-nav"> 
 
        <li> 
 
         <a href="#">About</a> 
 
        </li> 
 
        <li> 
 
         <a href="#">Services</a> 
 
        </li> 
 
        <li> 
 
         <a href="#">Contact</a> 
 
        </li> 
 
       </ul> 
 
      </div> 
 
      <!-- /.navbar-collapse --> 
 
     </div> 
 
     <!-- /.container --> 
 
    </nav> 
 

 
    <div class="full"> 
 

 
    </div> 
 

 
    <!-- Page Content --> 
 
    <div class="container"> 
 

 
     <hr class="featurette-divider"> 
 

 
     <!-- First Featurette --> 
 
     <div class="featurette" id="about"> 
 
      <img class="featurette-image img-circle img-responsive pull-right" src="http://placehold.it/500x500"> 
 
      <h2 class="featurette-heading">This First Heading 
 
       <span class="text-muted">Will Catch Your Eye</span> 
 
      </h2> 
 
      <p class="lead">Donec ullamcorper nulla non metus auctor fringilla. Vestibulum id ligula porta felis euismod semper. Praesent commodo cursus magna, vel scelerisque nisl consectetur. Fusce dapibus, tellus ac cursus commodo.</p> 
 
     </div> 
 

 
     <hr class="featurette-divider"> 
 

 
     <!-- Second Featurette --> 
 
     <div class="featurette" id="services"> 
 
      <img class="featurette-image img-circle img-responsive pull-left" src="http://placehold.it/500x500"> 
 
      <h2 class="featurette-heading">The Second Heading 
 
       <span class="text-muted">Is Pretty Cool Too.</span> 
 
      </h2> 
 
      <p class="lead">Donec ullamcorper nulla non metus auctor fringilla. Vestibulum id ligula porta felis euismod semper. Praesent commodo cursus magna, vel scelerisque nisl consectetur. Fusce dapibus, tellus ac cursus commodo.</p> 
 
     </div> 
 

 
     <hr class="featurette-divider"> 
 

 
     <!-- Third Featurette --> 
 
     <div class="featurette" id="contact"> 
 
      <img class="featurette-image img-circle img-responsive pull-right" src="http://placehold.it/500x500"> 
 
      <h2 class="featurette-heading">The Third Heading 
 
       <span class="text-muted">Will Seal the Deal.</span> 
 
      </h2> 
 
      <p class="lead">Donec ullamcorper nulla non metus auctor fringilla. Vestibulum id ligula porta felis euismod semper. Praesent commodo cursus magna, vel scelerisque nisl consectetur. Fusce dapibus, tellus ac cursus commodo.</p> 
 
     </div> 
 

 
     <hr class="featurette-divider"> 
 

 
     <!-- Footer --> 
 
     <footer> 
 
      <div class="row"> 
 
       <div class="col-lg-12"> 
 
        <p>Copyright &copy; Your Website 2014</p> 
 
       </div> 
 
      </div> 
 
     </footer> 
 

 
    </div> 
 
    <!-- /.container --> 
 

 
    <!-- jQuery --> 
 
    <script src="js/jquery.js"></script> 
 

 
    <!-- Bootstrap Core JavaScript --> 
 
    <script src="js/bootstrap.min.js"></script> 
 

 
</body> 
 

 
</html>

+0

मुश्किल है में इस कोड डाल दिया। आप सिर्फ एक div छवि को एक div पर लागू कर सकते हैं और यह एंडोमोदो की साइट - http://codepen.io/anon/pen/MKqdKj जैसा दिखेगा। नोट: वे div को ऊंचाई लागू करते हैं ताकि यह ब्राउज़र व्यूपोर्ट का आकार हो, जो जावास्क्रिप्ट में किया जाएगा। – unpollo

+0

मैंने इसे पहले से ही चेक आउट किया है, यह बूटस्ट्रैप के साथ फिट नहीं है। मैं एक उत्तरदायी दृश्य प्राप्त करने की कोशिश कर रहा हूं – Habchi

उत्तर

3

आदेश बूटस्ट्रैप में एक div पूर्ण आकार बनाने के लिए आप कंटेनर-द्रव वर्ग का उपयोग करने की जरूरत है। आप निम्न कोड का उपयोग करके एक पूर्ण पृष्ठ चौड़ाई उत्तरदायी छवि div प्राप्त कर सकते हैं।

<div class="container-fluid" style="padding: 0"> 
    <div class="banner img-responsive" 
     style="background-image: url('http://res.cloudinary.com/dhlsxlkrc/image/upload/v1447118604/spring-purple-flowers-1080p-hd_dg4ncq.jpg'); height: 400px;"> 
</div> 

तो बताने के लिए आप के लिए क्या देख रहे हैं जहाँ आप <div class="full"></div>

+0

मैं अपना

हटा देता हूं और इसे अपने स्निपेट द्वारा प्रतिस्थापित करता हूं लेकिन यह काम नहीं करता है! :( – Habchi

+0

क्या आपके पास कोई काम करने वाला स्निपेट कोड है जिसे मैं रिले कर सकता हूं? – Habchi

+0

मैं आपको कुछ कामकाजी कोड प्राप्त करने पर काम कर रहा हूं। कस लें। – kemosabe

संबंधित मुद्दे