HTML页面问题
我刚刚用这段代码创建了一个html页面HTML页面问题,html,Html,我刚刚用这段代码创建了一个html页面 <!doctype html> <html> <head> <meta charset="utf-8"> <title>RLGaming</title> <style type="text/css"> body { text-align: center; background-color: #000000; width: 1600px;
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>RLGaming</title>
<style type="text/css">
body {
text-align: center;
background-color: #000000;
width: 1600px;
margin: 0px auto;
padding: 20px;
/*border: 1px solid black;*/
}
</style>
</head>
<body>
<img src="test/SplashPageFinished.png" alt="" width="1600" height="1400" usemap="#Map" style=""/>
<map name="Map">
<area shape="rect" coords="333,447,596,907" href=>
<area shape="rect" coords="673,447,938,908" href=>
<area shape="rect" coords="1002,446,1267,907" href=>
<area shape="rect" coords="752,1019,801,1039" href=>
<area shape="rect" coords="487,60,1092,355" href=>
</map>
</body>
</html>
RLGaming
身体{
文本对齐:居中;
背景色:#000000;
宽度:1600px;
保证金:0px自动;
填充:20px;
/*边框:1px纯黑*/
}
试穿弹性盒!把事情放在中心位置真的很容易:)
将包装器ID用作主容器,并为其指定宽度,然后应用自动边距
代码
#Wrapper{
width: 1600px;
margin: 0px auto;
padding: 20px;
}
我认为你也必须尝试在你的页面中重置css,这可以帮助你
每个浏览器都有自己的默认“用户代理”样式表。重置样式表的目标是减少浏览器在默认行高、页眉边距和字体大小等方面的不一致
重置CSS:
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
在这两个测试中都尝试使用ctrl-f5。是否可以将链接发布到您的页面?放置。。。。。我不是在运行css。所有内容都在html文件中,与css无关。这意味着“不运行css”。对于页面的展示,你需要使用CSS。它只是在这个简单的index.html文件上运行。你可以在head中添加CSS,无需添加额外的CSS文件。我在head中得到了一个CSS脚本text align:center;背景色:#000000;宽度:1600px;保证金:0px自动;填充:20px;我不是在运行css。所有内容都在html文件中,与css无关。是否删除了正文的样式?
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}