好吧我真的新的所有这一切,因此在这里开始我的TAFE 的CSS部分IM是如何在页面上定位div?
我一直要求增加
- 名单
- 表10行和5列
- 背景图片
- 和三个链接。
但我可以弄清楚如何将所有这些东西放置在不同的位置?
有帮助吗? 这是我的一切,到目前为止
这是可悲的
我知道
div {
/* Purple box */
height: 150px;
width: 30%;
border: 10px solid purple;
background-color: purple;
}
/* link colour change and dots */
a {
color: black;
}
ul.a {
list-style-type: circle;
}
/* This Part is making the underline come on and off the links*/
a:link {
text-decoration: none;
}
a:visited {
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
a:active {
text-decoration: underline;
}
<center>
<h1> Welcome to Brakeys webpage </h1>
</center>
<div id=a>
<center>
<p>Check out these awesome bands!:</p>
</center>
<center>
<br><a href="http://violentsoho.com/">Violent Soho</a>
</br>
</center>
<center>
<br><a href="https://tiredlionband.bandcamp.com/">Tired Lion</a>
<br>
</center>
<center>
<br><a href="https://dunerats.bandcamp.com/">Dune Ratz</a>
<br>
</center>
</div>
<div id=b>
<ol>
Top 5 best bands
<li>Nirvana</li>
<li>Pearl Jam</li>
<li>Pink Floyd</li>
<li>Foo Fighters</li>
<li>Bob Dylan</li>
</ol>
</div>
看看CSS'position'属性 –
如果你想在一行中显示它们,然后使用float或display:inline-block; –
有不同的地方,一个在另一个之下,只是它们之间没有差距。 –