CSS对齐/滚动条问题
是的,这个滚动条还有另一个问题
,所以我再次启动了提到的网站 这里
,我再次遇到了这个滚动条的问题
,好吧,所以我所拥有的只是 div 标签中的单个图像,
<div align="center" id="SuggestionBox">
<a href="?PageN=2"><img src="images/SuggestionBox.jpg"/></a>
</div>
此代码显示正确,但是
当我将浏览器窗口设置得足够小时看不到完整的图像,它没有给我一个滚动条来看到整个图像
希望这是有道理的 我正在使用 firefox
编辑:
我尝试了溢出:滚动,但它不起作用,
这就是结果
这发生在中间 我还通过 css 在页面
主体上尝试了“overflow:scroll”,它所做的只是显示禁用的滚动条,无论浏览器的大小如何,滚动条都不会改变
,而且有些人有点困惑 所以 这张图片可能有帮助
注意图像没有完全显示
,我希望有滚动条,以防用户想看到整个图像图像
,但它们没有出现,
这里也是我所有的 css 代码:
body
{
background-image:url("images/background.jpg");
}
a:hover
{
color:#FF0000;
}
table
{
background-color:#FFFFFF;
}
#SuggestionBox
{
position:relative;
right:375px;
}
谢谢
,好运气
得到它?
yes another problem with this scroll bar
alright so I started the website over again that was mentioned here
and I am having problems with this scroll bar again
alright so all I have is a single image in a div tag
<div align="center" id="SuggestionBox">
<a href="?PageN=2"><img src="images/SuggestionBox.jpg"/></a>
</div>
this code displays right but
when I make the browser window small enough that the full image can not be seen it doesn't give me a scroll bar to see the whole image
hopefully this makes sense
I am using firefox
EDIT:
I tried overflow:scroll and it did not work
this was the outcome
and this happened in the middle of the page
I also tried 'overflow:scroll' on the body of the page through css and all it did was show disabled scroll bars that did not change no matter the size of the browser
also some people are a bit confused
so
this picture might help
notice how the image is not fully shown
well, I want there to be scroll bars in case the user wants to see the whole image
but they're not appearing
also here is all my css code:
body
{
background-image:url("images/background.jpg");
}
a:hover
{
color:#FF0000;
}
table
{
background-color:#FFFFFF;
}
#SuggestionBox
{
position:relative;
right:375px;
}
thanks
Good Luck
get it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我可能不明白你的问题,但看起来你的问题是你已经禁用了
body
中的滚动,但希望div
滚动。 @lukiffer 的答案是正确的。但是,当您调整浏览器大小时,固定大小的滚动div
不会溢出,因为其内容仍然适合。您是否希望“SuggestionBox”div 锚定到页面,以便它随页面调整大小?这将使它能够像浏览器一样改变大小,从而在内容不适合时添加滚动条:
更新:
我不明白
#SuggestionBox
的含义成为。如果您只是想要一个居中的图像链接,您可以去掉div
并将其作为标记:对于
,您可以使用以下 CSS:
如果您使用 div 的原因是为链接提供 375px 的右边距,则您的 CSS 可以将边距设置为
0 375px 0 auto
。如果您使用这个简单的 HTML/CSS,您的正文应该能够正常滚动(除非您还没有发布其他 CSS 或 HTML 来破坏它)。
I may not be understanding your question, but it looks like your problem is that you've disabled scrolling in the
body
but would like thediv
to scroll. @lukiffer's answer is right. When you resize your browser, however, the scrollingdiv
, which is a fixed size, isn't overflowing because its content still fits.Are you wanting your "SuggestionBox" div to anchor to the page so that it resizes along with the page? That would enable it to change sizes as the browser does and thus add scroll bars when its content doesn't fit:
Update:
I don't get what
#SuggestionBox
is supposed to be. If you're just wanting a centered image link, you could get rid of thediv
and just have this as your markup:And for that
<a/>
, you could have the following CSS:If your reason for having the div was to give your link a right margin of 375px, your CSS could have the margin set to
0 375px 0 auto
instead.If you use this simple HTML/CSS, your body should be able to scroll normally (unless you have other CSS or HTML that you haven't posted that's breaking it).