How do I center a website - Page 2 -...

User 2499354 Photo


Registered User
21 posts

I find VSD very restrictive and doesn't produce professional results. HTML is great though. You you want a centered layout feel free to use my css template below.



<!DOCTYPE html public "-//w3c//dtd html 4.01 transitional//en" "http://www.w3.org/tr/html4/loose.dtd">
<html>

<head>
<title>Marks template</title>


<!-- you can copy and rename any of the div's below to create extra ones and the adjust the left and top values

example div.new { position:absolute; top:110px; left:377px; width: 169px; z-index:3; } would control the

<div class="new">

</div> --------- -->

<style type="text/css">

div.header { position:absolute; top:3px; left:11px; width: 650px; z-index:0; }

div.board { position:absolute; top:65px; left:11px; width: 650px; z-index:1; }

div.main { position:absolute; top:110px; left:11px; width: 500px; z-index:3; }

div.mainleft { position:absolute; top:110px; left:11px; width: 331px; z-index:3; }

div.mainright { position:absolute; top:110px; left:377px; width: 169px; z-index:3; }

div.mainlower { position:absolute; top:302px; left:11px; width: 100px; z-index:13;}

div.lower { position:absolute; top:441px; left:13px; width: 100px; z-index:13;}

body { margin: 0px; text-align: center; height: 100%; width: 100%;}




#container { position:relative; top:10%; margin: 0px auto 0 auto; height: 100%; width:680px; text-align:left; padding-left:0px;}


</style>

</style>
</head>

<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" bgcolor="#ffffff" link="#0000ff" vlink="#800080"><!-- centering -->

<div id="container"><!-- --------- -->

<table width="680" height="680" border="1" cellspacing="0" cellpadding="0"><!-- container size & boarder make the 1 a 0 to remove boarder --------- -->
<tr>
<td>
<br>
</td>
</tr>
</table>


<div class="header">

<!-- content goes here--------- -->
Header content
</div>


<div class="board">

<!-- content goes here--------- -->
Lower header content
</div>


<div class="main">

<!-- content goes here--------- -->
main content
</div>



<div class="lower">

<!-- content goes here--------- -->

lower content
</div>


</div> <!-- do not delete this--------- -->



</body>
</html>

User 166871 Photo


Registered User
185 posts

Mark
Thanks for the template...I use HTML for some sites and VSD for others. I see advantages to both.
Cayucostom
Vista Tom


User 2733 Photo


Ambassador
426 posts

cayucostom wrote:
David
Where exactly in VSD do I add this centering code.


Anywhere inside the body tags.

&mark - I wasn't directing my comments to anyone here in the forum. In my "forum smart arse" experience, people tend to recommend CSS markup to do the simplest jobs that can be accomplished with basic HTML markup. The center tag isn't going anywhere. It's basic HTML 101 and while many of these deprecated elements are frowned upon in favor of CSS, they're not gonna be removed completely in the future.

Now, for those of you who want a solution for vertical / horizontal center, a :40 search with google returned this: http://www.dynamicsitesolutions.com/css/center-page-content-horizontally-and-vertically/
Let's not get all hurt.
User 166871 Photo


Registered User
185 posts

David
Unless I am mistaken, I would have to add this "<center>blah</center>" using an html editor outside of VSD as I see no way to encapsulate the entire body inside the center tags in VSD.

Lastly I have to agree with Mark your sarcastic and impatient responses, while informative at some level do nothing to enhance my experience of this forum though you are correct most of what you provide is available elsewhere with a little "googling" or a search of the forums. Guess I am missing what you have going that makes you validated by your arrogance.


Cayucostom
Vista Tom


User 282670 Photo


Registered User
3,940 posts

Hi cayucostom,
I have a question for you, I read but didn't find the answer. In VSD is the "centered" checked under the "Standard Setting For New Pages".
http://kellyinfo.com/web/centered.jpg




User 166871 Photo


Registered User
185 posts

Bruzer
This is checked but only works on horizontal placement for me. To lower or center the page vertically is what I am after. I can get there by adding manually adding top/bottom margin to the html/css code, but have to do this every time I revise the site. I am using VSD 5.9.4 and looking for 6.0 to be released soon and maybe it will address this.

cayucostom

Vista Tom


User 2733 Photo


Ambassador
426 posts

Let's review a moment:

mark barnard wrote:
I would be very greatful if someone could let me know how I can get a site to centre its self on all monitor sizes. As an example, this current page appears in the centre of my widescreen monitor with blank space either side and also appears in the centre of the screen when i view it on my regular 15 inch monitor.

I have heard frames and framesets can acheive this but I don't realy want to use them. If i view the source of this current page I can't see any frame tags so how can it be done?

I mainly use dreamweaver 8

Any help would be gratiously appreciated.


To which I replied:

David Sellers wrote:


I'm amazed at the number of people who make things more difficult than they need to be.


I didn't write "..the number of people in this forum" or "..in this thread." It was a generalization. My mistake as I meant no offense.

Then, this response from the guy who wrote "Any help would be gratiously appreciated."

mark barnard wrote:
Smat arse. What would people like you to to feel big if it weren't for forums?


As you can read, I was attacked. I attacked no one.

Then we read from cayucostom:

cayucostom wrote:
Where exactly in VSD do I add this centering code. Putting it in the header doesnt work. For some reason when I use the center option in VSD pages settings it only centers horizontally not vertically.


Now, the original poster spoke of Dreamweaver, a raw HTML editor. My response about the center tags was aimed at this type of editor.

I have no experience with VSD made obvious by my naive response to cayucostom, "inside the body tags." I guess you can't edit VSD pages like an HTML editor to add that code but again my response wasn't about VSD.

I apologize if anyone took offense (glances at mark barnard and cayucostom). I'll keep to myself. Good luck.
Let's not get all hurt.
User 282670 Photo


Registered User
3,940 posts

No Dave,
Please Stay And Help You are Always A Great Help To This Forum.
I'm always learning from everyone that helps here. And organized posting Dave I agree but don't see it happening as I am guilty of it too!




User 364143 Photo


Guest
5,410 posts

Dave, don’t roll over so easily to these lib Nazis. Your FREE advice has helped many on these boards. The back button is usually found at the top of the browser folks. C-YA!

Boohoo, “you wrote something in my thread that I disapprove of”, boohoo, “you wasted my time starting that thread”, boohoo, “you ruined my forum experience”, boohoo, "I purchased the Big Cup and now I am deserving", boohoo, boohoo, boohoo!

I’ve got your back, Dave. You E-thug ‘em and I’ll wave my E-penis while beating my keyboard violently.
CoffeeCup... Yeah, they are the best!
User 2733 Photo


Ambassador
426 posts

Bruzer, Tom..

Thanks for your kind words. I enjoy helping people here but I'm not gonna let someone with 8 posts scare me away from the forum. I'll just watch some bat around CSS theories how to center a page and wait for the light bulb to go on.

I want to be clear on something now. The first inquiry in this thread was about centering a site in all monitors sizes. Nothing was said about fostering an understanding of advanced CSS techniques to get it done. My innocuous response regarding the <center> tag was only meant to bring attention to the fact that this 'lil ol tag gets brushed aside sometimes too quickly in favor of more advanced techniques that can sometimes complicate an otherwise simple task.

I don't dredge these forums looking to insult people nor do I belittle those who ask for help. I don't come here to get help, I come here to give help.

Take it or use CSS and leave it. THAT was sarcasm.
Let's not get all hurt.

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.