作者othree (OOO)
看板Web_Design
标题Re: [问题] 关於CSS的问题
时间Sun Aug 19 15:04:08 2007
※ 引述《tatsuo769 (fish)》之铭言:
: 想请问各位
: 我是刚接触CSS的新手
: 我希望可以在网站的top上有banner,这个我可以
: 但是我希望在图片或是我的site name的右边可以有一些字或者是textbox
: |---------------------------------------------------------------|
: | |
: | Site name Search -----------button |
: | |
: -----------------------------------------------------------------
: 可是每次都换行变成下面的样子
: |---------------------------------------------------------------|
: | |
: | Site name |
: | Search -----------button |
: | |
: -----------------------------------------------------------------
: div#banner
: {
: color: #fff;
: background-color: #333;
: border-bottom: 1px solid #000;
: }
: <div id="banner">
: <h1>Site name</h1>
: </div>
: 请问有前辈可以教我吗?感谢
方法其实不少
这只是其中一种
要了解的就是div, form都属於block物件
如果没有透过css去修改位置或display属性的话
他们一定会在不同行
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"
http://www.w3.org/TR/html4/strict.dtd">
<style type="text/css">
html, body {
margin: 0;
padding: 0;
}
h1 {
margin: 0;
padding: 0;
color: #fff;
background: #000;
height: 1.5em;
line-height: 1.5em;
text-indent: 0.5em;
}
#search {
position: absolute;
top: 0.75em;
right: 0.5em;
}
</style>
<h1>Site Name</h1>
<form id="search">
<input type="text" />
<input type="submit" />
</form>
--
http://blog.othree.net/
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.118.5.39