CSS 如何设置网站的宽度?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/9907460/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to set the width of the website?
提问by Ahmad
I have created a theme for the zen cart site but the site's width is not setting from me.
我为禅车网站创建了一个主题,但网站的宽度不是我设置的。
There is a horizontal scrolling on the site.
网站上有一个水平滚动。
Here is my site. http://harleydragon.info
这是我的网站。 http://harleydragon.info
Please tell me how to solve this problem?
请告诉我如何解决这个问题?
回答by Giorgio Minardi
The style is not very good. You're including multiple css and redefining the body several times. Read on how to writea css and then give it a clean.
风格不是很好。您包含多个 css 并多次重新定义主体。 阅读有关如何编写css 的内容,然后对其进行清理。
回答by Kishore Kumar
You can use
您可以使用
<style type="text/css">
body{
width:90% /* or you can also set 900px*/
}
</style>
回答by KurvaF9
Try setting width in percentage:
尝试以百分比设置宽度:
#wrapper { width: 100%; }
回答by kubedan
Can you add(or modify) some css file?
你能添加(或修改)一些 css 文件吗?
If yes set
如果是设置
.your_website_class {
width: your_width px !important;
}
回答by The Alpha
Your body have these
你的身体有这些
width: 1500px; // set appropriate width
height: 1600px; // remove this line
fix these.
修复这些。