简单问题(2栏布局) [英] Simple Question (2 column layout)

查看:59
本文介绍了简单问题(2栏布局)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我基本上有标准的两列布局,但我正在运行

到一个怪癖我希望有人可以提供帮助。我有一栏

这是屏幕的主要内容(75%),剩下的25%是

为side保留内容。


我的CSS的问题是,如果主要内容的高度比侧面内容的高度小,那么边框的高度就是一边内容将包含在

的主要内容中,而不是保持在25%的范围内。


-me


------代码

#main

{

浮动:左;

宽度:75% ;

}


#side

{

}


然后是以下HTML代码

< html>


< div id =" main">

让我们说这部分文字在屏幕上占用三行。

< / div>


< div id =" side">

让我们说这部分有十行文字,前三行

就好了,这个div,另一行七行将换行并且

从#main div中的文本开始。 (而不是将#b $ b包装到#side div的开头)

< / div>


< / html> ;

------结束代码

I essentially have the standard two column layout, but I''m running
into a quirk I''m hoping someone can help with. I have one column
which is the main content (75%) of the screen and the remaining 25% is
reserved for "side" content.

The problem with my CSS is that if the main content''s height is less
than the side content''s height, the side content will wrap underneath
the main content instead of staying within the 25% bounds.

-me

------ code
#main
{
float: left;
width: 75%;
}

#side
{
}

and then the following HTML code
<html>

<div id="main">
let''s say the text in this section takes up three lines on the screen.
</div>

<div id="side">
let''s say this section has ten lines of text, the first three lines
will be just fine in this div, the other seven lines will wrap and
begin where text in the #main div would start. (instead of wrapping
to the start of the #side div)
</div>

</html>
------ end code

推荐答案

我应该补充一点,这是在IE6 / Win


2004年4月16日21:16:48 -0700,Alfred写道:
I should probably add that this was under IE6/Win

On 16 Apr 2004 21:16:48 -0700, Alfred wrote:
我基本上有标准的两列布局,但我'我正在跑步到一个怪癖我希望有人可以帮忙。我有一栏
这是屏幕的主要内容(75%),剩下的25%是为侧面保留的。内容。

我的CSS的问题是,如果主要内容的高度比侧面内容的高度小,那么副内容将包含在下面
主要内容而不是保持在25%的范围内。

-me

------代码
#main
{
float:left;
宽度:75%;
}





然后以下HTML代码
< html>

< div id =" main">
让我们说本节中的文字占用了三行屏幕。
< / div>

< div id =" side">
让我们说这部分有十行文字,第一行三行
将在这个div中正常,其他七行将包装并开始#main div中的文本将开始。 (而不是包装
到#side div的开头)
< / div>

< / html>
------结束代码
I essentially have the standard two column layout, but I''m running
into a quirk I''m hoping someone can help with. I have one column
which is the main content (75%) of the screen and the remaining 25% is
reserved for "side" content.

The problem with my CSS is that if the main content''s height is less
than the side content''s height, the side content will wrap underneath
the main content instead of staying within the 25% bounds.

-me

------ code
#main
{
float: left;
width: 75%;
}

#side
{
}

and then the following HTML code
<html>

<div id="main">
let''s say the text in this section takes up three lines on the screen.
</div>

<div id="side">
let''s say this section has ten lines of text, the first three lines
will be just fine in this div, the other seven lines will wrap and
begin where text in the #main div would start. (instead of wrapping
to the start of the #side div)
</div>

</html>
------ end code



我应该补充一点,这是在IE6 / Win


2004年4月16日21:16 :48-0700,Alfred写道:
I should probably add that this was under IE6/Win

On 16 Apr 2004 21:16:48 -0700, Alfred wrote:
我基本上有标准的两列布局,但我正在运行
变成一个怪癖我希望有人可以提供帮助用。我有一栏
这是屏幕的主要内容(75%),剩下的25%是为侧面保留的。内容。

我的CSS的问题是,如果主要内容的高度比侧面内容的高度小,那么副内容将包含在下面
主要内容而不是保持在25%的范围内。

-me

------代码
#main
{
float:left;
宽度:75%;
}





然后以下HTML代码
< html>

< div id =" main">
让我们说本节中的文字占用了三行屏幕。
< / div>

< div id =" side">
让我们说这部分有十行文字,第一行三行
将在这个div中正常,其他七行将包装并开始#main div中的文本将开始。 (而不是包装
到#side div的开头)
< / div>

< / html>
------结束代码
I essentially have the standard two column layout, but I''m running
into a quirk I''m hoping someone can help with. I have one column
which is the main content (75%) of the screen and the remaining 25% is
reserved for "side" content.

The problem with my CSS is that if the main content''s height is less
than the side content''s height, the side content will wrap underneath
the main content instead of staying within the 25% bounds.

-me

------ code
#main
{
float: left;
width: 75%;
}

#side
{
}

and then the following HTML code
<html>

<div id="main">
let''s say the text in this section takes up three lines on the screen.
</div>

<div id="side">
let''s say this section has ten lines of text, the first three lines
will be just fine in this div, the other seven lines will wrap and
begin where text in the #main div would start. (instead of wrapping
to the start of the #side div)
</div>

</html>
------ end code





" Alfred" < OM *** @ yahoo.com>写道......

"Alfred" <om***@yahoo.com> wrote...
我的CSS的问题是,如果主要内容的高度比侧面内容的高度少,那么副内容将会包裹在主要内容之下而不是保持在25%范围内。

-me

------代码
#main
{
浮动:左;
宽度:75%;
}

#side
{
}
The problem with my CSS is that if the main content''s height is less
than the side content''s height, the side content will wrap underneath
the main content instead of staying within the 25% bounds.

-me

------ code
#main
{
float: left;
width: 75%;
}

#side
{
}



样式表:


#main {

宽度:75%;

}


#side {

浮动:正确;

宽度:25%;

}


html:


< div id =" side">

content

< / div>


< div id =" main">

content

< / div>


首先放置#side div,向右浮动,将允许

围绕它流动的主要内容。 #side内容不会在声明宽度之外流动



问候,

吉姆


这篇关于简单问题(2栏布局)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆