/    Sign up×
Community /Pin to ProfileBookmark

Margins on website?

I’m totally new to webdesign and started out using a WYSIWYG editor – hence the poor code. I then moved on to updating the website in Microsoft Notepad and have experimented with image maps etc.

I would like to make a new website sometime in the future however for now I’d rather just tweak the existing one as much as possible.

My basic problem is that I would like to have margins either just one on the right or one on the left and one on the right – restricting the width of the webpage (see example).

[url]http://cars.uk.msn.com/Reviews/article.aspx?cp-documentid=740747[/url]

My question is – is this simply a case of inserting a TABLE or is it going to be very difficult?

Here is my website.

[url]www.beechesrecovery.co.uk[/url]

Regards

an_trading

to post a comment
HTML

4 Comments(s)

Copy linkTweet thisAlerts:
@vsspAug 10.2006 — Hai try Macromedia Dreamweaver its very helfull to change the design insert new table very easy.

Its free edition available . so download and install ur sysytem.
Copy linkTweet thisAlerts:
@WebJoelAug 10.2006 — I'm totally new to webdesign and started out using a WYSIWYG editor - hence the poor code. I then moved on to updating the website in Microsoft Notepad and have experimented with image maps etc.

I would like to make a new website sometime in the future however for now I'd rather just tweak the existing one as much as possible.


My basic problem is that I would like to have margins either just one on the right or one on the left and one on the right - restricting the width of the webpage (see example).

http://cars.uk.msn.com/Reviews/article.aspx?cp-documentid=740747

My question is - is this simply a case of inserting a TABLE or is it going to be very difficult?

Here is my website.

www.beechesrecovery.co.uk

Regards

an_trading[/QUOTE]



Assuming you're using a TABLE structure, do this:

<!doctype html public "-//W3C//DTD XHTML 1.0 Strict//EN"

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html>

<head>

<title> New Document </title>

<meta name="Generator" content="" />

<meta name="Author" content="" />

<meta name="Keywords" content="" />

<meta name="Description" content="" />

<style type="text/css">

body, html {margin:0; padding:0; border:0;} /* Re-sets IE to "zero" for these values */

</style>

</head>

<body>

<table style="[B]width:405px; margin:25px auto; [/B]height:400px; border-left:2px solid black; border-right: 2px solid black;">

<tr>

<td>< -- border-left &nbsp;&nbsp;<em><big><b>some content here, etc.</b></big></em>&nbsp;&nbsp; border-right -- ><br />

<p>Set a WIDTH first, then establish a margin. "Margin:25px auto" sets this table 25-pixels from the TOP of the screen, and auto-aligns (left/right and bottom, if applicable) the rest. Centered! </p></td>

</tr>

</table>

</body>

</html>

Quick review: set a defined WIDTH first, then give the margin the property of "auto" to subtract the width of the element (here, a TABLE) and dived the remaining width equally to the remaining sides of left & right.
Copy linkTweet thisAlerts:
@an_tradingauthorAug 13.2006 — Thank you very much - just need to tinker with it. Will post up my results maybe.
Copy linkTweet thisAlerts:
@felgallAug 13.2006 — Best NOT to use a table though except for displaying tabular data. You have a lot more flexibility with page layout using stylesheet commands without a table than you do with a table.
×

Success!

Help @an_trading spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...