Html 标题间距
我的头撞在墙上,这里。如有任何建议,将不胜感激 我想要一个标题,我将在我的页面上使用,其中的图像和文本将改变,但风格不会改变。所有的图片都是399x207,我想让图片左边的标题框填满这个空间。我希望标题框是207px高 我尝试过tables(当前版本)和其他方法,但似乎没有什么是我需要/想要的 这是我请求中奇怪的部分,如果有人回答的话,可以提供指导/提示,而不是为我做。这是家庭作业,我渴望学习。谢谢Html 标题间距,html,css,Html,Css,我的头撞在墙上,这里。如有任何建议,将不胜感激 我想要一个标题,我将在我的页面上使用,其中的图像和文本将改变,但风格不会改变。所有的图片都是399x207,我想让图片左边的标题框填满这个空间。我希望标题框是207px高 我尝试过tables(当前版本)和其他方法,但似乎没有什么是我需要/想要的 这是我请求中奇怪的部分,如果有人回答的话,可以提供指导/提示,而不是为我做。这是家庭作业,我渴望学习。谢谢 h1 { color: #f4ead0; text-align: center; } h2 {
h1 {
color: #f4ead0;
text-align: center;
}
h2 {
background-color: #5d432c;
color: #f4ead0;
font-size: 1.2em;
text-align: center;
}
table, td {
margin: 0px;
padding: 0px;
border-spacing: 0;
}
#header {
border-radius: 15px;
margin-left: auto;
margin-right: auto;
width: 70%;
min-width: 700px;
}
#wrapper {
border-radius: 15px;
margin-left: auto;
margin-right: auto;
width: 70%;
min-width: 700px;
background-color: #745336;
}
.box {
border-radius: 15px;
border: 2px solid #bd6e02;
text-align: center;
background-color: #745336;
}
<!-- Header -->
<div id="header">
<table style="width:100%">
<tr>
<td class="box" colspan="2">
<h1>A Brief Discussion of Fractals</h1>
<h2>The Mandelbrot Set</h2>
</td>
<td rowspan="2">
<img class="box" src="mandelbrot.gif" alt="Part of the Mandelbrot Set">
</td>
</tr>
</table>
</div>
h1{
颜色:#f4ead0;
文本对齐:居中;
}
氢{
背景色:#5d432c;
颜色:#f4ead0;
字体大小:1.2米;
文本对齐:居中;
}
表,td{
边际:0px;
填充:0px;
边界间距:0;
}
#标题{
边界半径:15px;
左边距:自动;
右边距:自动;
宽度:70%;
最小宽度:700px;
}
#包装纸{
边界半径:15px;
左边距:自动;
右边距:自动;
宽度:70%;
最小宽度:700px;
背景色:#745336;
}
.盒子{
边界半径:15px;
边框:2px实心#bd6e02;
文本对齐:居中;
背景色:#745336;
}
浅谈分形
曼德布罗特集
您是否尝试过引导中的
标题
。顺便说一句,喜欢你自己学习的精神。您可能还需要应用一些CSS。这可能会起作用,尽管我还没有测试过它
首先,将第一个
设置为100%宽,这样它将尝试装入整个表中,第二个
上的内容将折叠
接下来,在
上放置一个空格:nowrap
,这样里面的任何东西都不会折叠
<div id="header">
<table style="width:100%" border=1>
<tr style="white-space:nowrap">
<td class="box" colspan="2" width="100%">
<h1>A Brief Discussion of Fractals</h1>
<h2>The Mandelbrot Set</h2>
</td>
<td rowspan="2">
<img class="box" src="mandelbrot.gif" alt="Part of the Mandelbrot Set">
</td>
</tr>
</table>
</div>
浅谈分形
曼德布罗特集
不要使用表格。除非这是你家庭作业的要求。。。使用表格的网站布局等是非常非常过时的,我的坏做法是这样做的!我不得不改变一些事情,我仍然在努力使图像与左框的大小相同,但谢谢!使用表格进行布局不是最佳做法。表仅用于数据表示。使用divs而不是true,你应该使用divsThanks,我来看看!