2017-06-10 90 views
-1

我剛剛學習HTML/CSS和我有一個小問題的背景和文本框我不明白爲什麼它不工作 可能有人告訴我最新的問題以及如何解決它? 問候HTML/CSS背景和文本框問題

我認爲旋轉木馬的疊加層有些問題,但這只是猜測和填寫這個文件的文字,以便能夠porst它...我的意思是爲什麼有這麼高的文字需要這個是一個短代碼,我寧願只讀的,而不是讀這篇長文無用的代碼...

body 
 
{ 
 
background-color: black; 
 
} 
 
#Haupt 
 
{ 
 
    color: yellow; 
 
    align-content: center; 
 
} 
 

 
.header1 
 
{ 
 

 
} 
 
h1 
 
{ 
 
} 
 
/* The navigation bar */ 
 
.navbar { 
 
    overflow: hidden; 
 
    background-color: #333; 
 
    position: fixed; /* Set the navbar to fixed position */ 
 
    top: 0; /* Position the navbar at the top of the page */ 
 
\t 
 
    width: 100%; /* Full width */ 
 
} 
 

 
/* Links inside the navbar */ 
 
.navbar a { 
 
    
 
\t overflow: hidden; 
 
    display: block; 
 
    color: #f2f2f2; 
 
    text-align: center; 
 
    padding: 14px 16px; 
 
    text-decoration: none; 
 
} 
 

 
/* Main content */ 
 
.main { 
 
    margin-top: 30px; /* Add a top margin to avoid content overlay */ 
 
} 
 
h1:hover 
 
{ 
 
    background-color: dimgray; 
 
} 
 

 
.tales { 
 
width: 100%; 
 
height: 100%; 
 
} 
 
.carousel-inner{ 
 
width:100%; 
 
height: 10%; 
 
max-height: 500px !important; 
 
min-width: 1366px !important; 
 
} 
 

 

 
.textbox1 { 
 
   position: abolute; /*position auf der Seite absolut */ 
 
   left:200px; /*position von links */ 
 
   top: 40px; /*position von oben */ 
 
   width: 300px; /*Breite der Box */ 
 
   font-family: Verdana, Geneva, sans-serif; 
 
   font-size: 1.2em; 
 
   text-align: center; 
 
   height: 300px; /*Höhe der Box */ 
 
   border: solid blue 1px; /* Rand durchgezogen blau 1px stark */ 
 
   padding:20px; /* Innenabstand vom Text zum Rand */ 
 
   background-color:#fff; /* Hintergrundfarbe */ 
 
   border-radius:15px; /* Ecken mir Rundungsradius */ 
 
   box-shadow: 3px 3px 5px 1px #000; /*schatten Ausrichtung links, oben,      Abstand von der Box, Ausdehnung, Farbe */ 
 
   opacity:0.8; /* Transparenz */ 
 
} 
 

 
    
 
/*Nav bar*/ 
 
.main { 
 
    margin: 0px; 
 
    width: 980px; 
 
\t height: 10px; 
 
    } 
 
.links { 
 
    float:left; 
 
    
 
} 
 
.rechts { 
 
\t width: 200px; 
 
right: 0px; 
 
position: absolute; 
 
top: 0px; 
 
margin-top: 0px; 
 
margin-right: 0px; 
 
margin-bottom: 0px; 
 
    
 
}
<!DOCTYPE html> 
 
<html lang="en"> 
 
<head> 
 
<style> 
 
body { 
 
\t 
 
\t margin:0; \t  
 
\t background-color: darkblue; 
 
\t } 
 
\t 
 
\t 
 
\t 
 
.navbar { 
 
    overflow: hidden; 
 
    background-color: #333; 
 
    position: fixed; 
 
    top: 0; 
 
    width: 100%; 
 
} 
 

 
.navbar a { 
 
\t overflow: hidden; 
 
    float: left; 
 
    display: block; 
 
    color: #f2f2f2; 
 
    padding: 14px 16px; 
 
    text-decoration: none; 
 
    font-size: 17px; 
 
} 
 

 
</style> 
 
\t <link rel="stylesheet" href="Stylesheet.css"> 
 
    <h1>Bootstrap Example</h1> 
 
    <meta charset="utf-8"> 
 
    <meta name="viewport" content="width=device-width, initial-scale=1"> 
 
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> 
 
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> 
 
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> 
 
</head> 
 
<body> 
 

 
\t 
 
\t 
 
<div clas="textbox1"> 
 
\t <a>sdf</a> 
 
</div> 
 
\t 
 
\t 
 
<div class="navbar"> 
 
    <div class="main"> 
 
     <div class="links"> 
 
      <a href="#Dafuq"> DFUQ </a> 
 
\t \t \t <a href="#Dafuq"> DFUQ </a> 
 
\t \t \t <a href="#Dafuq"> DFUQ </a> 
 
     </div> 
 
     <div class="rechts"> 
 
      <a href="#Dafuq"> Fuchs Julian </a> 
 
     </div> 
 
    </div> 
 
</div> \t 
 
<div class="container-fluid"> 
 
    <h2>Carousel Example</h2> 
 
    <div id="myCarousel" class="carousel slide" data-ride="carousel"> 
 
    <!-- Indicators --> 
 
    <ol class="carousel-indicators"> 
 
     <li data-target="#myCarousel" data-slide-to="0" class="active"></li> 
 
     <li data-target="#myCarousel" data-slide-to="1"></li> 
 
     <li data-target="#myCarousel" data-slide-to="2"></li> 
 
    </ol> 
 

 
    <!-- Wrapper for slides --> 
 
    <div class="carousel-inner"> 
 
     <div class="item active"> 
 
     <img src="Bild1.jpg" alt="Los Angeles" width = "100%"> 
 
     </div> 
 

 
     <div class="item"> 
 
     <img src="Bild2.jpg" alt="Chicago" width = "100%" > 
 
     </div> 
 
    
 
     <div class="item"> 
 
     <img src="Bild3.jpg" alt="New york" width = "100%"> 
 
     </div> 
 
    </div> 
 

 
    <!-- Left and right controls --> 
 
    <a class="left carousel-control" href="#myCarousel" data-slide="prev"> 
 
     <span class="glyphicon glyphicon-chevron-left"></span> 
 
     <span class="sr-only">Previous</span> 
 
    </a> 
 
    <a class="right carousel-control" href="#myCarousel" data-slide="next"> 
 
     <span class="glyphicon glyphicon-chevron-right"></span> 
 
     <span class="sr-only">Next</span> 
 
    </a> 
 
    </div> 
 
</div> 
 
</body> 
 
</html>

+1

什麼是你期待看到你沒有看到? –

+0

我期望看到一個藍色的背景和一個彩色的文本框...但沒有出現......背景是白色的,文本框只是一個正常的鏈接 –

回答

0

你有幾個拼寫錯誤代替clas="textbox1"使用class="textbox1",做一些修改像下面

body { 
 
    background-color: black; 
 
} 
 

 
#Haupt { 
 
    color: yellow; 
 
    align-content: center; 
 
} 
 

 
.header1 {} 
 

 
h1 {} 
 

 

 
/* The navigation bar */ 
 

 
.navbar { 
 
    overflow: hidden; 
 
    background-color: #333; 
 
    position: fixed; 
 
    /* Set the navbar to fixed position */ 
 
    top: 0; 
 
    /* Position the navbar at the top of the page */ 
 
    width: 100%; 
 
    /* Full width */ 
 
} 
 

 

 
/* Links inside the navbar */ 
 

 
.navbar a { 
 
    overflow: hidden; 
 
    display: block; 
 
    color: #f2f2f2; 
 
    text-align: center; 
 
    padding: 14px 16px; 
 
    text-decoration: none; 
 
} 
 

 

 
/* Main content */ 
 

 
.main { 
 
    margin-top: 30px; 
 
    /* Add a top margin to avoid content overlay */ 
 
} 
 

 
h1:hover { 
 
    background-color: dimgray; 
 
} 
 

 
.tales { 
 
    width: 100%; 
 
    height: 100%; 
 
} 
 

 
.carousel-inner { 
 
    width: 100%; 
 
    height: 10%; 
 
    max-height: 500px !important; 
 
    min-width: 1366px !important; 
 
} 
 

 
.textbox1 { 
 
    position: absolute; 
 
    left: 200px; 
 
    top: 40px; 
 
    width: 300px; 
 
    font-family: Verdana, Geneva, sans-serif; 
 
    font-size: 1.2em; 
 
    text-align: center; 
 
    height: 300px; 
 
    border: solid blue 1px; 
 
    padding: 20px; 
 
    background-color: #fff; 
 
    border-radius: 15px; 
 
    box-shadow: 3px 3px 5px 1px #000; 
 
    opacity: 0.8; 
 
} 
 

 

 
/*Nav bar*/ 
 

 
.main { 
 
    margin: 0px; 
 
    width: 980px; 
 
    height: 10px; 
 
} 
 

 
.links { 
 
    float: left; 
 
} 
 

 
.rechts { 
 
    width: 200px; 
 
    right: 0px; 
 
    position: absolute; 
 
    top: 0px; 
 
    margin-top: 0px; 
 
    margin-right: 0px; 
 
    margin-bottom: 0px; 
 
}
<!DOCTYPE html> 
 
<html lang="en"> 
 

 
<head> 
 
    <style> 
 
    body { 
 
     margin: 0; 
 
     background-color: darkblue; 
 
    } 
 
    
 
    .navbar { 
 
     overflow: hidden; 
 
     background-color: #333; 
 
     position: fixed; 
 
     top: 0; 
 
     width: 100%; 
 
    } 
 
    
 
    .navbar a { 
 
     overflow: hidden; 
 
     float: left; 
 
     display: block; 
 
     color: #f2f2f2; 
 
     padding: 14px 16px; 
 
     text-decoration: none; 
 
     font-size: 17px; 
 
    } 
 
    </style> 
 
    <link rel="stylesheet" href="Stylesheet.css"> 
 
    <h1>Bootstrap Example</h1> 
 
    <meta charset="utf-8"> 
 
    <meta name="viewport" content="width=device-width, initial-scale=1"> 
 
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> 
 
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> 
 
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> 
 
</head> 
 

 
<body> 
 

 

 

 
    <div class="textbox1"> 
 
    <a>sdf</a> 
 
    </div> 
 

 

 
    <div class="navbar"> 
 
    <div class="main"> 
 
     <div class="links"> 
 
     <a href="#Dafuq"> DFUQ </a> 
 
     <a href="#Dafuq"> DFUQ </a> 
 
     <a href="#Dafuq"> DFUQ </a> 
 
     </div> 
 
     <div class="rechts"> 
 
     <a href="#Dafuq"> Fuchs Julian </a> 
 
     </div> 
 
    </div> 
 
    </div> 
 
    <div class="container-fluid"> 
 
    <h2>Carousel Example</h2> 
 
    <div id="myCarousel" class="carousel slide" data-ride="carousel"> 
 
     <!-- Indicators --> 
 
     <ol class="carousel-indicators"> 
 
     <li data-target="#myCarousel" data-slide-to="0" class="active"></li> 
 
     <li data-target="#myCarousel" data-slide-to="1"></li> 
 
     <li data-target="#myCarousel" data-slide-to="2"></li> 
 
     </ol> 
 

 
     <!-- Wrapper for slides --> 
 
     <div class="carousel-inner"> 
 
     <div class="item active"> 
 
      <img src="Bild1.jpg" alt="Los Angeles" width="100%"> 
 
     </div> 
 

 
     <div class="item"> 
 
      <img src="Bild2.jpg" alt="Chicago" width="100%"> 
 
     </div> 
 

 
     <div class="item"> 
 
      <img src="Bild3.jpg" alt="New york" width="100%"> 
 
     </div> 
 
     </div> 
 

 
     <!-- Left and right controls --> 
 
     <a class="left carousel-control" href="#myCarousel" data-slide="prev"> 
 
     <span class="glyphicon glyphicon-chevron-left"></span> 
 
     <span class="sr-only">Previous</span> 
 
     </a> 
 
     <a class="right carousel-control" href="#myCarousel" data-slide="next"> 
 
     <span class="glyphicon glyphicon-chevron-right"></span> 
 
     <span class="sr-only">Next</span> 
 
     </a> 
 
    </div> 
 
    </div> 
 
</body> 
 

 
</html>

+0

謝謝你的文本框現在的作品...但仍然有問題背景......但理論上,它應該工作,當這個工程...爲什麼我不能做到這一點。對... –

+0

@ julianfuchs拼寫錯誤不會工作。我很高興它有幫助。請接受和upvote,如果它工作 – jafarbtech

+0

我upvoted我已經但你不會看到它,因爲我是新的堆棧 –