如何修复div包装器 [英] How do I fix my div wrapper

查看:74
本文介绍了如何修复div包装器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在网页上制作div包装代码时遇到了困难。



这是我的HTML文件中的内容

 <  !DOCTYPE     html  >  
< 标题 >
< div id = 包装 >
< h1 > 示例h1标题< / h1 >

< p > Lorem ipsum dolor sit amet,consectetur adipisicing elit,sed do eiusmod tempor incididunt ut labore et dolore magna aliqua。 Ut enim ad minim veniam,quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat。 Duis aute irure dolor in repreptderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur。不受欢迎的,不正当的,非法的,在法庭行政当局,法律责任,法律责任,法律责任,法律保护,法律诉讼,法律诉讼,法律诉讼,法律诉讼,法律诉讼,法律诉讼,法律诉讼法span class =code-keyword>>

< h2 > 示例h2标题< / h2 >
< ul >
< li > 列出第1项< / li >
< li > Li第二项< / li >
< li > 列表项目三< / li >
< / ul > ;

< ! - 结束 包装器 - >



这是我的CSS文件中的内容,

  / *   stylesheet.css * /  
/ * 身体的风格规则y元素* /

body {
background-color white;
background- image url(pix / 587e13b9482b2.jpg);
background-repeat no-repeat;
/ * 默认字体样式* /
font 10pt Arial,Helvetica,Sans-Serif;
颜色 #5d3f25;

}

/ * 包的样式规则pper div * /
wrapper {
width 900px;
margin 0 auto;
background-color white;
border soild 2px#4c2e16;
border -radius 20px;
box-shadow 8px 8px 8px black;
}

/ * h1标题的样式* /
h1 {
font italic small-caps bold 24px Arial Black,Gadget,Sans-Serif;
text-shadow - 2px -2px 2px#a48362;
text-align center;
}
/ * h2标题的样式* /
h2 {
font italic small-caps bold 18px Arial黑色,小工具,Sans-Serif;
text-shadow - 1px -1px 1px#a48362;
}
/ * 段落样式* /
p {
line-height 1.5;
}

我可以让其他一切工作,即背景,颜色,字体这样的东西,但我似乎无法让白盒背景工作。如果有人可以帮助我,我将永远感恩,因为我对如何解决问题感到茫然。



这也是页面的链接,< br $>


file:///Users/taylargealy/Desktop/Intro%20HTML5/HTML5%20Template.htm





非常感谢



我的尝试:



我已经完成了我所学到的一切,与不同的人交谈,并观看了关于这个问题的视频,我似乎无法弄清问题是什么。我在Mac电脑上试过Safari和Firefox,没有任何效果。我甚至已经开始使用新文档并尝试重写所有内容。

解决方案

啊....你关闭了div标签吗?(和标题标签)

I am having a hard time with making a "div wrapper" code on my web page.

Here is what is in my HTML File

<!DOCTYPE html>
<title>
  <div id="wrapper">
	<h1>Sample h1 Heading</h1>

<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore  eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, in culpa qui officia deserunt mollit anim id est laborum</p>

<h2>Sample h2 Heading</h2>
<ul>
   <li>List item one</li>
   <li>List item two</li>
   <li>List item three</li>
</ul>

  <!—-End wrapper—->


And here is what is in my CSS file,

/* stylesheet.css */
/* Style rule for the body element */

body{
	background-color:white;
	background-image:url(pix/587e13b9482b2.jpg);
	background-repeat:no-repeat;
	/* Default font styling */
   	font: 10pt Arial, Helvetica, Sans-Serif;
   	color: #5d3f25;
		
}

/*Style rule for the wrapper div*/
#wrapper{
   	width:900px;
	margin:0 auto;	
	background-color:white;
	border:soild 2px #4c2e16;
	border-radius:20px;
	box-shadow:8px 8px 8px black;
}

/* Style for h1 headings */
h1{
   font:italic small-caps bold 24px Arial Black, Gadget, Sans-Serif;
   text-shadow:-2px -2px 2px #a48362;
   text-align:center;
}
/* Style for h2 headings */
h2{
   font:italic small-caps bold 18px Arial Black, Gadget, Sans-Serif;
   text-shadow:-1px -1px 1px #a48362;
}
/* Style for paragraphs */
p{
  line-height:1.5;
}

I can get everything else to work, i.e. the background, colors, fonts stuff like that, but I can't seem to get the white box background to work. If someone could help me, I would forever be thankful because I am at a loss on how to fix the problem.

This is also the link to the page,

file:///Users/taylargealy/Desktop/Intro%20HTML5/HTML5%20Template.htm


Thanks so much

What I have tried:

I have done everything I have learned, talked to different people, and watched videos on this problem and I can't seem to figure out what is the problem. I am on a Mac computer and have tried Safari and Firefox and nothing has worked. I have even started over with a new document and tried rewriting everything.

解决方案

ah.... Did you close the div tag?(and the title tag)


这篇关于如何修复div包装器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆