网络营销电子商务研究中心

网络营销电子商务研究中心 (https://www.0058.net/index.php)
-   Web Directory (https://www.0058.net/forumdisplay.php?f=60)
-   -   Specify Width (https://www.0058.net/showthread.php?t=2253)

sunshine 2007-03-20 07:58 PM

Specify Width
 
Q:
How do I set the width of the overall directory to a fixed width instead of the width="100%' that it is currently set at. I could go in and find all instances but don't want to screw it up and reinstall it.

A1:Take a look in the main.css and at the top of the file you'll see
Quote:

body {
background: #FFFFFF;
font-family: Verdana, Tahoma, Arial, sans-serif;
font-size: 8pt;
}
Simply add a width attribute like so.
Quote:

body {
background: #FFFFFF;
font-family: Verdana, Tahoma, Arial, sans-serif;
font-size: 8pt;
width: 700px;
}
Q: How do I get it to center on the page?

A:Probably the easiest thing to do is enclose what you want to be centered in

<div align="center"> </div>

tags

This *should* centre what you need to be centred.

Have you modified your header files at all to enclose the directory in a table, or have you just used the suggestion below to reduce the width?

A2:Actually your best bet with this is super simple.

below your newly added width, add the margins like so.
Quote:

margin-left: auto;
margin-right: auto;
Here would be the finished code.
Quote:

body {
background: #FFFFFF;
font-family: Verdana, Tahoma, Arial, sans-serif;
font-size: 8pt;
width: 700px;
margin-left: auto;
margin-right: auto;
}


All times are GMT +8. The time now is 10:38 PM.

Powered by vBulletin Version 3.8.7
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.