我正在尝试使用html和css创建一个页面,可能还有一些php,但是我遇到了一些css的意外问题,而且我没有想法。
<h1>X-Corp</h1>
<p class="hp">
<b><i>Dominating and Redefining IT</i></b>
</p>
<div class=contact>
<p>email: bigchuk00@gmail.com</p>
<p>Tel : +2348062202958</p>
</div>
<div>
<p class="page1">In this ever-evolving world we live in, the growth of
IT related problems is always on the rise. Thats where we come in.
With our top-notch engineers, IT gurus, system analysts and
impecceble graphics team, we devote our 110% time and effort to be
there for you, lending a hand to solving all your IT related issues.
</p>
<p class="page2">
Are you a techie or just someone who desires to acquire an IT related
device or material and dont know how? Search no more because WE at
X-Corp have just completed international pertnership plans and
contract to ensure we help you seamlessly to achieve that technically
challenging objective of yours. Be it building a gaming rig, a server
powerhouse, that geeky crib you've been dreaming of, or even getting
your full scale company or organisation up to date with the latest in
the IT world, believe me, we got you covered. <a href="ourcmd.php">Read
more</a>
</p>
</div>
</body>
但是从h1标签到page1类的所有内容都不会接受css中的某些值。 这是css代码:
.page1
{color : black;
background : e3e3e3;
margin : left;
widrh : 200px;
float : rightt;
}
.page2
{color : black;
background-color : e3e3e3;
width : 200px;
margin : left;
float : right;}
任何帮助将不胜感激。刚开始学习CSS。
答案 0 :(得分:4)
几乎所有的css都无效。
.page1
{
color : black;
background : e3e3e3; <- should be #e3e3e3
margin : left; <- should be a readable value. like margin: 0 10px 0 5px
widrh : 200px; <- should be width
float : rightt; <- should be right
}
答案 1 :(得分:1)
这是一个JSfiddle,有一些修复。我对你想要的东西做了一些假设,但你可以通过点击&#34; Run&#34;来玩它。在你做出改变之后。一些错误是你需要在十六进制颜色前面#,边距不需要&#34;左&#34;它需要类似&#34; 0px&#34;或&#34; 20px&#34;。 &#34; auto&#34;让它居中。你也拼错了几句。
.page1 {
color : black;
background : #e3e3e3;
margin : 0px auto;
width : auto;
margin-bottom: 20px;
}
.page2 {
color : black;
background-color : #e3e3e3;
width : auto;
margin : 0px auto;
}
答案 2 :(得分:0)
一些注意事项:
.page1
的CSS中,您撰写了rightt
而不是right
。background-color: #e3e3e3
代替background : e3e3e3;
(也适用于.page1
)background-color: #e3e3e3;
background-color : e3e3e3;
代替.page2