html - 主要内容背景全宽

标签 html css

.main 背景有问题。我正在尝试获得全宽背景,但我做不到。我已经看过一些类似的问题,但我无法解决我的问题。这是我的代码。这是我的字体,因此您可以更好地理解我的观点。 Fonts

<!DOCYPE html>
<html>
	<head>
		<title>MaxSkins-Home</title>
		
<style type="text/css">
		
		body {
			background-color: white;    
			background-attachment: fixed;              
			margin: 0;
			padding: 0;
			width: 100%;
			height: auto;
			min-width: 1000px;
		}

		@font-face {
			font-family: "Jocker";
			src: url("JockeyOne-Regular.ttf") format("truetype");
		}

		@font-face {
			font-family: "Pacifica";
			src: url("PacificaCondensed-Regular.ttf") format("truetype"); 
		}

		@font-face {
			font-family: "ReklameScript";
			src:url("ReklameScript.ttf") format("truetype");
		}

		h1 {
			font-size: 120px;
			text-align: left;
			font-family: "Jocker";
			margin-left: 45;
			color: rgb(200,101, 103);
		}		

		h2 {
			font-size: 70;
			margin-left: 224;
			font-family: "Jocker";
			color: rgb(200,101, 103);
		}

		#header {
			width: 100%;
			height: 50px;
			margin: auto;
	
		}
		
		#navigacija {
			width: 100%;
			margin-left: 0px;
			padding: 0px;
			height: 50px;  
			overflow: hidden;
			text-align: right;
			position: fixed;
			background-color: #089DE3;
			z-index: 9999;			
		}
		
		#navigacija a {
			color: white;
			text-decoration: none;
			line-height: 50px; 
			font-size: 30px; 
			font-family: "Pacifica";
			display: inline-block;
			padding-left: 50px;
			padding-right: 50px;
			padding-top: 0px;
			padding-bottom: 0px;
		}
	
		#navigacija a:hover {
			background: #00C5CD;
		}
		
		.main1 {
			margin-top: 50px;
			font-family: "ReklameScript";
			font-size: 50;
			background: #089DE3;
			text-align: left;
			margin-left: 194;
		}
		
		.video-container {
			position: relative;
			padding-bottom: 56.25%;
			padding-top: 0px;
			height: 0;
			overflow: hidden;
			bottom: 930;
			right: 0px;
		}
		.video-container iframe,  
		.video-container object,  
		.video-container embed {
			position: absolute;
			top: 0;
			left: 0;
			width: 100%;
			height: 100%;
		}
		.video-wrapper {
			width: 640px;
			float: right;
			margin-left:auto;
			margin-right:auto;
			max-width: 100%;
		}
</style>		
		

		</head>

<body>
	<div id="header">
	<div id="navigacija">
     		<a href="Home.html"><b>HOME</b></a> 
     		<a href="Shop.html"><b>SHOP</b></a> 
     		<a href="#"><b>GET POINTS</b></a> 
     		<a href="#"><b>INFO</b></a> 
     
  	</div>
	</div>


		<h1><b>EARN POINTS,<br> GET SKINS!</b></h1>
		<h2><b>How does it work?</b></h2>
	<div class="main1">
		<p><b>It's simple!<br> Watch videos, do tasks and have fun!<br>After earning large amount of coins,<br> contact us to get your skins!<b></p>
	
	</div>

	<div class="video-wrapper">
	<div class="video-container">
		<iframe width="640" height="360" src="https://www.youtube.com/embed/lwItL2NXwDw" frameborder="5" allowfullscreen></iframe>
	</div>
	<!-- /video -->
</div>
<!-- /video-wrapper -->	
</body>
</html>

最佳答案

您的问题似乎是一些无效的 CSS。你有一个 <style></style>标记在您的 CSS 中,但仅当 CSS 位于您的标记 (HTML) 中时才需要。

我从你的 CSS 中删除了 HTML 标签,并且 - 至少对我来说 - .main1现在有一个全 Angular 背景。 我假设那是你的问题..?

关于html - 主要内容背景全宽,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42284745/

相关文章:

html - 用另一张图片覆盖 body 背景

html - 页脚被切断?

html - 如何使带有 Logo 的导航栏居中?

javascript - 使用 Collection2 在 Meteor 中插入空白的嵌入式架构

Javascript 故障效果,文本太大,如何调整大小?

css - 如何在 Bootstrap 中创建非粘性页脚?

javascript - 如何在我的 div 中而不是在我的窗口中有滚动条?

html - 在 CSS 位置使用 Materialise 的画廊?

html - 文本鼠标悬停触发的基于 CSS 的横幅图像交换

html - 向左浮动 span 和 div