/    Sign up×
Community /Pin to ProfileBookmark

Resizing your webpage

hi
i am using Frontpage on XP and would like to ask how i resize my webpage so that it is in the middle of the page when people view it: plz visit [URL=http://www.freewebtown.com/footballmanagercentral]FMC[/URL] You can see if you continue to football manager central by clicking on the writting that my web page is basically orientated to the left. i would like to centre the page but i am unsure how to. I am using shared borders as well. So how do i centre my page when it is view thanks very much livin_dragon

to post a comment
HTML

11 Comments(s)

Copy linkTweet thisAlerts:
@PeOfEoJan 25.2005 — www.bluerobot.com has examples of centered layouts and fluid layouts that use css. Is that what you were looking for?
Copy linkTweet thisAlerts:
@livin_dragonauthorJan 25.2005 — ive got the writing in the middle to resize however the shared borders wont does anyone know how to get the borders to recentre
Copy linkTweet thisAlerts:
@phpnoviceJan 25.2005 — MS Shared Borders are not intended to be positioned anywhere except -- at the borders. That is why they are called that. To do otherwise would require turning off Shared Borders on that page and using server-side code to dynamically extract the Shared Border content and insert it into the page as desired. I have written PHP code that does something very similar to this -- except that it mimics the same positioning that Shared Borders uses. If you want my code, you could easily modify it to build auto-centering "borders".
Copy linkTweet thisAlerts:
@livin_dragonauthorJan 25.2005 — cam i please have it then much appreciated

thx
Copy linkTweet thisAlerts:
@phpnoviceJan 26.2005 — What this does is to extract the content between the opening and closing BODY tags of the MS Shared Border documents in the _borders folder. Then, the same TABLE elements that MS uses are wrapped with the extracted content. Thus, you can change the kind of tags and attributes that are used for these wrappers. Good luck.

[code=php]<?php
function GetSharedBorder($b, $opt = 'BEG')
{
// get border content
if ($b !== 'right' and $opt == 'BEG'
or $b == 'right' and $opt == 'END') {
$f = "{$_SERVER["DOCUMENT_ROOT"]}/_borders/{$b}.php";
$s = @fopen($f, 'r');
if ($s == false) {
$content = '<p>open_error</p>';
} else {
$content = @fread($s, filesize($f));
@fclose($s);
$s = preg_match('/<body[^>]*>(.*)</body>/is', $content, $matches);
if ($s == false) {
$content = '<p>not_found</p>';
} else {
$content = $matches[1];
}
}
} else {
$content = '<p>&nbsp;</p>';
}
// add wrappers to the border content
switch (true) {
case ($b == 'top'):
$border = '<table border="0" cellpadding="0" cellspacing="0" width="100%"><tr>';
$border .= '<!--begin_top_border--><td style="padding:0;">';
$border .= $content;
$border .= '</td><!--end_top_border--></tr></table>nn';
break;
case ($b == 'left'):
if ($opt == 'BEG') {
$border = '<table dir="ltr" border="0" cellpadding="0" cellspacing="0" width="100%"><tr>';
$border .= '<!--begin_left_border--><td valign="top" width="1%" style="padding:0;">';
$border .= $content;
$border .= '</td><!--end_left_border--><td valign="top" width="24" style="padding:0;"></td>';
$border .= '<!--begin_main_area--><td valign="top" style="padding:0;">n';
} else {
$border = '</td><!--end_main_area--></tr></table>nn';
}
break;
case ($b == 'right'):
if ($opt == 'BEG') {
$border = '<table dir="ltr" border="0" cellpadding="0" cellspacing="0" width="100%"><tr>';
$border .= '<!--begin_main_area--><td valign="top" style="padding:0;">n';
} else {
$border = '</td><!--end_main_area--><td valign="top" width="24" style="padding:0;"></td>';
$border .= '<!--begin_right_border--><td valign="top" width="1%" style="padding:0;">';
$border .= $content;
$border .= '</td><!--end_right_border--></tr></table>nn';
}
break;
case ($b == 'bottom'):
$border = '<table border="0" cellpadding="0" cellspacing="0" width="100%"><tr>';
$border .= '<!--begin_bottom_border--><td style="padding:0;">';
$border .= $content;
$border .= '</td><!--end_bottom_border--></tr></table>nn';
break;
default:
$border = "{$content}n";
}
// return the completed content
return $border;
}
?>[/code]

The following is an example of how the above is used to create a top, left, and bottom shared border.
<i>
</i>&lt;body&gt;

&lt;?php
echo GetSharedBorder("top");
echo GetSharedBorder("left", "BEG");
?&gt;

&lt;!-- document content goes here --&gt;

&lt;?php
echo GetSharedBorder("left", "END");
echo GetSharedBorder("bottom");
?&gt;

&lt;/body&gt;
Copy linkTweet thisAlerts:
@phpnoviceJan 26.2005 — Also note the following example of how to create a top, left, right, and bottom shared border.
<i>
</i>&lt;body&gt;

&lt;?php
echo GetSharedBorder("top");
echo GetSharedBorder("left", "BEG");
?&gt;

&lt;!-- document content goes here --&gt;

&lt;?php
echo GetSharedBorder("right", "END");
echo GetSharedBorder("bottom");
?&gt;

&lt;/body&gt;
Copy linkTweet thisAlerts:
@livin_dragonauthorJan 26.2005 — thx i will try it later
Copy linkTweet thisAlerts:
@livin_dragonauthorJan 26.2005 — sorry to bug you again but i dont know how to paste the code above into my frontpage html i only need the top and left border so could you please help me thankyou very much
Copy linkTweet thisAlerts:
@phpnoviceJan 26.2005 — Basically, you cut-n-paste it into Notepad first. Then, from Notepad, you cut-n-paste it into the HTML view of FrontPage. Going through Notepad strips out the formatting and creates plain text.
Copy linkTweet thisAlerts:
@phpnoviceJan 27.2005 — Cheers.
×

Success!

Help @livin_dragon 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.6,
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: @Yussuf4331,
tipped: article
amount: 1000 SATS,

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

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...