CSS - 更改总宽度

发布于 2024-10-09 01:06:27 字数 245 浏览 0 评论 0原文

我有一个 Blogger 模板,它比屏幕宽度更宽,并导致显示水平滚动条。我想更改它,使其适合并且不显示滚动条。但问题是我不知道是什么原因造成的。我已经下载了模板文件,并在代码编辑器中查找所有 width 属性,并将所有 100% 更改为 90% 和像素宽度值value-100,但页面仍然像以前一样。

在寻找这种情况下有效的规则时,我还应该寻找/做什么?什么是全面检查事物以找出规律的程序?

I have a Blogger template which is wider than the screen-width and causes the horizontal scrollbar to be displayed. I want to change it so that it fits and no scrollbar is shown. But the problem is I don't know what is causing this. I have downloaded the template file and in my code editor looked for all width properties and changed all 100%s to 90% and pix width values to value-100, but still the page is as before.

In finding the effective rule/rules in a such cases, what else should I look for/do? What is a comprehensive procedure to check things to find the rules?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

瞳孔里扚悲伤 2024-10-16 01:06:27

不要更改宽度,而是尝试将 CSS 属性 overflow:hidden 添加到您认为可能导致问题的所有内容,然后将它们一一删除,直到滚动条重新出现,您将得到罪魁祸首。您可能还需要将其添加到 htmlbody 中。如果滚动条没有显示任何实际内容,您可以将 overflow:hidden 保留在罪魁祸首上以解决问题。

Instead of changing the width, try adding the CSS property overflow: hidden to everything you think might be causing the issue and then remove them one-by-one until the scroll bar reappears and you'll have the culprit. You might need to add it to html and body as well. If the scrollbars aren't revealing any actual content, you can leave the overflow: hidden on the culprit to resolve the issue.

青春有你 2024-10-16 01:06:27

导致问题的可能不是宽度属性 - 模板内可能存在一个不环绕或浮动的块元素,它可能会拉伸您的容器如果容器的宽度是使用百分比定义的。

使用固定宽度定义根容器,这应该可以消除许多此类问题。请先尝试一下,然后告诉我们是否有效。

It might not be a width property that's causing the problem - there might be a block element inside your template that doesn't wrap or float that might be stretching out your container if the widths of the containers are defined using percentages.

Define the root container using a fixed width and this should eliminate many of those sorts of issues. Try that first and let us know if it works.

小瓶盖 2024-10-16 01:06:27

程序:

1)。了解盒子模型以及它在 IE 上的变化。 “宽度”问题实际上可能与宽度一样是由填充、边距甚至边框引起的。

2)。检查其他浏览器中的渲染情况。如果您可以在 FF 中重现该问题,请获取 Firebug 并使用它来找出有问题的元素的计算尺寸,并向下挖掘它的子元素,这很可能会导致问题。 Chrome 有一个与 Firebug iirc 类似的调试器,但我不熟悉它。

3)。如果这不能告诉您问题是什么,请开始从 CSS 中删除规则或整个模式,直到问题消失(或者删除所有内容并逐步添加回来,直到问题再次出现) - 那时您就知道是什么原因造成的问题(如果不是原因),并且您可以随时更新问题,在确定问题后询问我们原因。

hth

(如果其中任何一个已经很明显的话,请原谅)

Procedure:

1). Understand the box model and how this varies on IE. It is just as likely that a problem "width" may actually be caused by padding, margin, or even border as width.

2). Check the rendering in other browsers. If you can reproduce the problem in FF get Firebug and use that to find out the calculated dimensions of the element in question, and tunnel down through it's children which may well be causing the issue. Chrome has a similar debugger to Firebug iirc, but I'm not familiar with it.

3). If that doesn't tell you what the problem is, start removing rules or whole patterns from your CSS until the problem goes away (or remove everything and add it back in piecemeal until the problem returns) - at that point you know what is causing the issue, if not why, and you can always update the question to ask us why when you've identified it.

hth

(Apols if any of this was already obvious)

独自唱情﹋歌 2024-10-16 01:06:27

嗯,% 总是以“100”开头。看到body标签的宽度百分比设置为100%。然后根据它,只需根据显示中的要求设置其他成分%。

我个人确实相信,使用 % 比使用 'px' 更好。如果您了解 CSS,请尝试根据要求将“px”更改为 %。

Well, % always begins with "100". See the percentage of width of body tag is set to 100%. then according to it, just set other component % as per the requirement in your display.

Personally I do believe that, use of % is better then 'px'. If you know CSS, then try to change 'px' to % as per the requirement.

南风几经秋 2024-10-16 01:06:27

该组件似乎具有 min-width 样式和 overflow 属性 设置为自动。您可能需要将其设置为 visible 并在 FireBug 首先Firefox Page Inspector,在进行后期编辑之前查看效果。如果您只想调整整个帖子的宽度,blogger 有标准界面 。您还可以手动编辑模板

It seems that the component has min-width style and overflow property set to auto. You may want to set it to visible and do it in FireBug Firefox Page Inspector first, to see the effect alive before making post edit. If you just want to adjust the whole post width, blogger has standard interface. You can also edit the template manually

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文