Hi, Can anyone tell me how I go about fixing the width of my whole site to 1000 pixels and then centering it????????
Announcement
Collapse
No announcement yet.
Site Alignment
Collapse
X
-
You could use a table
The following will center your site with a blue bakground to the surrounding area
Insert the following just after your body tag just like this
Code:<body> <table width="100%" align="center"> <tr> <td bgcolor="#000066"></td> <td width="1000px" align="center">
Code:</td> <td bgcolor="#000066"></td> </tr> </table> </body>
Thanks PaulPaul Hesford
Web Design Wigan
Based in the Northwest of England UK, provides web design, programming, e-commerce and web hosting services
Cheap Whey Protein from Powerbeck
Web Designer in Wigan
Actinic Hosting
Dog Kennels and Runs
-
Blush
Hi
Ok could you please show me how the css method also
i have used the above seems to work OK
why is it so wrong
Thanks PaulPaul Hesford
Web Design Wigan
Based in the Northwest of England UK, provides web design, programming, e-commerce and web hosting services
Cheap Whey Protein from Powerbeck
Web Designer in Wigan
Actinic Hosting
Dog Kennels and Runs
Comment
-
Originally posted by paulhesfordwhy is it so wrong
- You are advising him to insert code that includes a body tag, below his body tag (prime spot for a double body tag mistake by a noob).
- Your table is missing the cellspacing and cellpadding attributes.
- You are using a table to center a site when CSS can do it all for you.
- You have added 'px' into the <td> width.
- You are colouring a table cell to get a background color, both actinic theme config or the normal body tag offer this facility in a much better manner.
If you have an outer table layout, then give the table an ID, such as:
<table id="outerWrapper" cellpadding="0" cellspacing="0">
and add to the css stylesheet:
#outerWrapper {
width: 1000px;
margin: 0 auto;
border: none;
padding: 0;
}
You are basically advising the addition of an extra table when there is no need as you can style the current one(s) and more important than that it's just a bad way to do things to be honest, it's inefficient, its code bloat for no reasons and just add to an ever growing list of nested tables in an actinic site.
If CSS layout, then the above is simpler still, it all depends on how your site is laid out currently as to what you decide to use, but tables are the last choice to achieve it.
Comment
-
So...
<div id="webbg">
<div id="pageWrapper"> ... </div>
</div>
and then in the actinic stylesheet something like:
#webbg (
width: 100%;
margin 0 auto;
border: none;
padding: 0;
background-color: #000066
#pageWrapper {
width: 1000px;
margin 0 auto;
border: none;
padding: 0;
}
Or can I edit pageWrapper to do this for me
Thanks
p.s. why dont people like tables anymore?Paul Hesford
Web Design Wigan
Based in the Northwest of England UK, provides web design, programming, e-commerce and web hosting services
Cheap Whey Protein from Powerbeck
Web Designer in Wigan
Actinic Hosting
Dog Kennels and Runs
Comment
-
Joint
Ahh thanks for pointing that out
erm well maybe you could help me a little more, could you sum it up in a brief sentence?
PaulPaul Hesford
Web Design Wigan
Based in the Northwest of England UK, provides web design, programming, e-commerce and web hosting services
Cheap Whey Protein from Powerbeck
Web Designer in Wigan
Actinic Hosting
Dog Kennels and Runs
Comment
-
Paul,
Are you not being a bit lazy here?
The internet is your friend for when you have a question you know, especially ones that have been asked before!
Search for itFergus Weir - teclan ltd
Ecommerce Digital Marketing
SellerDeck Responsive Web Design
SellerDeck Hosting
SellerDeck Digital Marketing
Comment
-
The URL is www.craftcompany.co.uk. I beleive its a table based site! Also any instruction on where to add this code your all arguing about would be very helpful!thank you please
Comment
-
You have set the outer table to be 1000 wide, but you then have the top row of the site set to be 1270 wide which then overrides your setting. Remove the 1270 and also reduce your banner size, how do you expect a site to reduce to 1000 wide if you are putting a 1270 wide image inside it?
I know the code can look a little confusing, but there is a very basic logic to follow. If you have a 30" wide door frame, can you fit a 40" box through it? It's an identical logic with web design.
Comment
Comment