Web applications 使用CSS的中心页面布局 启动文本编辑器(记事本),然后打开javajam.css文件。为名为wrapper的id添加样式,宽度设置为80%,右边距设置为自动,左边距设置为自动 启动文本编辑器,然后打开index.html文件。添加HTML代码以配置分配给id包装器的div元素,该id包装器“包装”或包含body部分中的代码。在浏览器中保存并测试index.html页面,您会注意到页面内容现在在浏览器视口中居中,如图3.27所示()
我的index.html文件有什么问题?我无法将主体居中? 索引。htmlWeb applications 使用CSS的中心页面布局 启动文本编辑器(记事本),然后打开javajam.css文件。为名为wrapper的id添加样式,宽度设置为80%,右边距设置为自动,左边距设置为自动 启动文本编辑器,然后打开index.html文件。添加HTML代码以配置分配给id包装器的div元素,该id包装器“包装”或包含body部分中的代码。在浏览器中保存并测试index.html页面,您会注意到页面内容现在在浏览器视口中居中,如图3.27所示(),web-applications,Web Applications,我的index.html文件有什么问题?我无法将主体居中? 索引。html <!DOCTYPE html> <html lang="en"> <head> <title> JavaJam Coffee House </title> <meta charset="utf-8"> <link href="javajam.css" rel="stylesheet"> </head> <body>
<!DOCTYPE html>
<html lang="en">
<head>
<title> JavaJam Coffee House </title>
<meta charset="utf-8">
<link href="javajam.css" rel="stylesheet">
</head>
<body>
<div id="wrapper">
<header>
<h1> JavaJam Coffee House </h1>
</header>
<nav>
<b><a href="index.html">Home</a>
<a href="menu.html">Menu</a>
<a href="Music.html">Music</a>
<a href="Jobs.html">Jobs</a></b>
</nav>
<ul>
<li>Specialty Coffee and Tea</li>
<li>Bagels, Muffins, and Organic Snacks</li>
<li>Music and Poetry Readings</li>
<li>Open Mic Night</li>
</ul>
<p>12312 Main Street<br>
Mountain Home, CA 93923<br>
1-888-555-5555<br>
</p>
<footer>
Copyright © 2014 JavaJam Coffee House<br>
<a href="mailto ImaniJackson@gmail.com">ImaniJackson@gmail.com</a>
</footer>
</div>
</body>
</html>
你想把文字居中吗?或者保持文本左对齐,并使包装文档在页面上居中?@Lee我想将文本居中包装没有文本对齐居中规则div@Lee子弹不在特产、咖啡和茶的旁边
body { background-color: #FFFFCC;
color: #330000;
font-family: Verdana, Arial, sans-serif; }
header { background-color: #CCAA66;
color: #000000;
text-align: center; }
h1 { line-height: 200%; }
nav { text-align: center; }
footer { background-color: #CCAA66;
color: #000000;
font-size: .60em;
font-style: italic;
text-align: center; }
#wrapper { width: 80%;
margin-left: auto;
margin-right: auto; }