How would I center a layout and give it a 1 px border?
Printable View
How would I center a layout and give it a 1 px border?
Do you mean the actual code?
Or doing it graphically in photoshop?
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.
Css:PHP Code:<style=border>
?PHP Code:.border {
border: 2px solid #color;
then put the <center> at the very beginning after the <html> <head> tags.
I want to make it valid, so iwho knows the way using CSS?
<div align="center">
under the body tag
</div>
before the </body> tag.
If your using tables just add align="center" to the table.
To center the layout add a div around it all I normaly call mine center, and in the css add this:
And if you want a border just use this;HTML Code:.center {
margin-left: auto;
margin-right: auto;
width: (enter the width of your whole design here)px;
}
HTML Code:.center {
margin-left: auto;
margin-right: auto;
width: (enter the width of your whole design here)px;
border: 1px;
}
Code:#container {
width: [designwidth]px;
margin: auto;
border-left: 2px solid #fff;
border-right: 2px solid #fff;
}
Cause he probably wouldn't want top and bottom borders. Thank **** there are some people (Ryan and Tom) that could actually work that out.
<center this f'in image now><border="100000000000"></center gone>
Add a border to something:
Centering:Code:#id {border: 1px solid #ffffff} /* Adds a 1px SOLID aka a line black border */
Another way to centeringCode: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 :) */
float left and margin-left: - 50% of width
So for example our box is:
Code:#box {float:left;width:500px;margin-left:-250px}
I've used redtom's way. Thanks for everyone who helped!