View Full Version : Centering + Border
adamFTW
29-09-2007, 02:01 PM
How would I center a layout and give it a 1 px border?
Spherical
29-09-2007, 02:03 PM
Do you mean the actual code?
Or doing it graphically in photoshop?
Invent
29-09-2007, 02:04 PM
Give the BODY the text-align of center maybe (or just use <center> tags which aren't valid though).
Then put the layout in a div and add "border: 1px solid #000000" to it's style.
adamFTW
29-09-2007, 02:05 PM
Give the BODY the text-align of center maybe (or just use <center> tags which aren't valid though).
Then put the layout in a div and add "border: 1px solid #000000" to it's style.
It centers the text, I want it to center the layout.
Assassinator
29-09-2007, 02:06 PM
<style=border>
Css:
.border {
border: 2px solid #color;
?
Spherical
29-09-2007, 02:06 PM
then put the <center> at the very beginning after the <html> <head> tags.
adamFTW
29-09-2007, 02:07 PM
I want to make it valid, so iwho knows the way using CSS?
MrCraig
29-09-2007, 03:33 PM
<div align="center">
under the body tag
</div>
before the </body> tag.
Lilian
29-09-2007, 03:38 PM
If your using tables just add align="center" to the table.
redtom
29-09-2007, 05:24 PM
To center the layout add a div around it all I normaly call mine center, and in the css add this:
.center {
margin-left: auto;
margin-right: auto;
width: (enter the width of your whole design here)px;
}
And if you want a border just use this;
.center {
margin-left: auto;
margin-right: auto;
width: (enter the width of your whole design here)px;
border: 1px;
}
RYANNNNN
29-09-2007, 05:30 PM
#container {
width: [designwidth]px;
margin: auto;
border-left: 2px solid #fff;
border-right: 2px solid #fff;
}
redtom
29-09-2007, 05:33 PM
#container {
width: [designwidth]px;
margin: auto;
border-left: 2px solid #fff;
border-right: 2px solid #fff;
}
What would be the point in having border-left and border-right if there the same?
RichardKnox
29-09-2007, 08:01 PM
Cause he probably wouldn't want top and bottom borders. Thank **** there are some people (Ryan and Tom) that could actually work that out.
RyanPaulNelson
29-09-2007, 08:14 PM
<center this f'in image now><border="100000000000"></center gone>
Sygon..
30-09-2007, 01:54 PM
Add a border to something:
#id {border: 1px solid #ffffff} /* Adds a 1px SOLID aka a line black border */
Centering:
body {text-align:center}
#thingtocenter {margin:auto} /* Works out it has to be centered as body text align is center hence is figures out the margins :) */
Another way to centering
float left and margin-left: - 50% of width
So for example our box is:
#box {float:left;width:500px;margin-left:-250px}
adamFTW
30-09-2007, 01:55 PM
I've used redtom's way. Thanks for everyone who helped!
Want to hide these adverts? Register an account for free!
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.