页面侧栏上的固定百分比 [英] Fixed Percent on Page Sidebar

查看:61
本文介绍了页面侧栏上的固定百分比的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用具有一栏和一侧边栏的页面格式.如开发人员所见,边栏设置为33.3%

I am using the page format with one column and one side bar. The sidebar is set to 33.3%, as seen in developer

class="ms-wiki-columnSpacing" style="width:33.3%

,但列和侧边栏会拉伸以容纳其内容.它们每个都有换行符,但是如果我输入一个长字符串Ex. (-----------------) 会在包装文字之前使空间更宽.还有大图 也会扩展空间.无论内容或浏览器大小如何变化,如何使区域保持在设定的百分比上?

but the column and sidebar stretch to accommodate their contents. They each have wrap text but if I put in a long character string Ex. (-----------------) its will make the space much wider before wrapping the text. Also any large picture will stretch the space as well.  How can I make the areas stay at the set percentage regardless of contents or browser resizing? This seems to be more of a problem in IE than Chrome.

推荐答案

凯特(Kate),

Hi Kates,

CSS宽度百分比旨在根据浏览器调整大小或放大图片来调整div宽度.

CSS width percent is designed to resize div width based on browser resizing or large picture.

如果要为div设置固定的CSS宽度,建议您为宽度指定详细的px值,如下所示:

If want to have a fixed CSS width for a div, I suggest you can specify detailed px value for width like below:

#div
{
   width:250px; /* or whatever width you want. */
   max-width:250px; /* or whatever width you want. */
   display: inline-block;
}

设置max-width = width,然后将其为固定宽度div.

Set max-width=width, then it will be a fixed width div.

谢谢

最好的问候


这篇关于页面侧栏上的固定百分比的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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