显示宽度 [英] Width of display

查看:92
本文介绍了显示宽度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近第一次将网页模板转换为DWT。似乎工作正常(除了一个问题,我可能会删除一些膨胀)。页面标题和菜单显示在整个屏幕上,而不仅仅是容器的选定宽度。我尝试过调整大小失败了。似乎我在森林中间​​而没有看到树木?有人能发现我忽略的东西吗?该网站是: http://www.taylor-computers.com/test/
提前致谢在您的CSS样式表中更改此信息:

 #header {
宽度:778px;
保证金:0px;
填充:1em;
身高:90px;
颜色:#254360;
clear:none;
text-align:center;
}



对此:
$

 #header {
宽度:778px;
保证金:0px auto;
填充:1em;
身高:90px;
颜色:#254360;
clear:none;
text-align:center;
}



添加自动保证金会使容器(宽度)居中。

我会做的是给您的宽度并以Container为中心,而不是容器内的各个块。让各个块(如标题)的宽度达到容器内部。这将允许您通过更改单个值(Container上的宽度)来更改总宽度。


I recently did my first conversion of a web template to a DWT.  Seems to have worked fine (with possibly some bloat I'll remove) except for one problem.  The page heading and menu display across the entire screen instead of just the chosen width of the container.  I have tried unsuccessfully to resize it.  Seems I'm in the middle of the forest and not seeing the trees??  Could someone spot something I'm overlooking?  The site is: http://www.taylor-computers.com/test/
Thanks in advance for your help.

解决方案

In your CSS stylesheet change this:

#header {
	width: 778px;
	margin: 0px;
	padding: 1em;
	height: 90px;
	color: #254360;
	clear: none;
	text-align: center;
}


To This:

#header {
	width: 778px;
	margin: 0px auto;
	padding: 1em;
	height: 90px;
	color: #254360;
	clear: none;
	text-align: center;
}


Adding the Margin of Auto causes the container (with a width) to center.

What I would do is give your width and centering on the Container and not the individual blocks within the container.  Let the individual blocks (like the header) be full width to the container its within.  This will allow you to change the overall width by changing a single value (width on the Container).


这篇关于显示宽度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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