Center web page on browser screen in Dreamweaver?





All web sites I have created and published in Dreamweaver have the pages come up on the browser screen on the left side. Is there a way to set up a site so the pages come up centered on all browser pages?
Hi, I guess it depends on your layout. Of you're using CSS then you need to set the left and right margin of your main container to auto. Please check example below.

HTML:

<div id="main"> test</div>

CSS: 

#main {

margin-right: auto;

margin-left: auto;

}

If you need to have a visual example for this, try opening a new HTML document using a CSS layout, you can do that by going to file>new>blank page> then select a CSS Layout for HTML.

I hope this post makes sense to you. 😉
You are using position:absolute; Don't, it usually leads to endless problems.



Even if you had a real need to use it, why are you placing things at left 1400px!!!



This is right on the edge of the average monitor - how large is your monitor? I work with my browser open at a width of about 1000-1200px (note I didn't mention the size of my monitor). The main reason people have big monitors is so they can have two windows open next to each other, not so that they can run a browser window open at 2800px wide.



I suggest you start by looking at ordinary websites and studying the css. you'll discover that many sites use a wrapper div with a fixed width, while others use a wrapper div with a percentage width and a max-width, to prevent ending up with a huge long line of text 2500px long for example. Then they center the div using margin:auto. That gets the content in the middle of the page on the vast majority of screens, and browser viewports.



Don't lay out a screen using position:absolute. You are not painting pretty pictures on a screen, you should be using html and css to control the layout and check how the layout looks every time, by resizing the window looking for errors.



Also, a contact form needs the input boxes to be part of a <form>, so you'll have to read up on how they work. And a form needs an action, so you'll have to learn a bit about scripting, probably php. You can detect the browser in use and display the message. You can even have it hide the page content unless the browser used is Internet Explorer. However, there's no way to use JavaScript (or any other web dev. code) to open a completely separate program.



If you are really determined, you might try looking into something that indirectly opens another program through an object or applet of some kind, like flash or Java applets. I don't think you'll find anything, though.



If this were possible, it would be a security problem. Consider the situation if IE had a known exploit and it were possible to force a page to open in IE regardless of the browser it was originally opened in.



I recommend fixing your site. It's not that difficult to develop pages that work everywhere. If I develop pages in accordance with the W3C recommendations, they work pretty well in Firefox, Safari, Opera, and Chrome. Then it's not too difficult to tweak them to work in IE. I've found that doing it the other way around, targeting IE first then tweaking it to work in other browsers, is much more difficult. Pages that require Microsoft ActiveX plugins are an exception of course, but I think it's well worth the time to find an alternative.



--  

-- Ghodmode use sections. the first page should be section 1. you can assign the master page elements to that section only. then all other pages will be in section 2, with a different master page with different elements. each section can pick up page numbering from the last or start at a new number. By adding 'margin-left: 205px' & 'margin-right: 400px' you're killing the '<center>', the correct way to do it is delete the '<center>' tags, and put 'margin-left: auto; margin-right: auto;' that will automatically center you div Put the grid inside a panel (rather than scrolling the grid itself) and the following in the head section of the page. This is set for using a MasterPage, but you can remove the "ctl00\_MainContentPlaceHolder\_" prefix for a regular page.  

  

XMLCopy Code

```
<script type="text/javascript" language="javascript">
        window.onload = function () {
                var strCook = document.cookie;

                if (strCook.indexOf("!~") != 0) {
                        var intS = strCook.indexOf("!~");
                        var intE = strCook.indexOf("~!");
                        var strPos = strCook.substring(intS + 2, intE);
                        document.getElementById("ctl00\_MainContentPlaceHolder\_pnlFindings").scrollTop = strPos;
                }

        }
</script>
<script type="text/javascript" language="javascript">
        function SetDivPosition() {
                var intY = document.getElementById("ctl00\_MainContentPlaceHolder\_pnlFindings").scrollTop;
                document.cookie = "yPos=!~" + intY + "~!";
        }
</script>
```
  

  

In the Panel, you'll need:   

 onscroll="SetDivPosition()"  

  

That should do it for you. Works for me, anyway. You will want to look at the httpwebrequest class and its methods. You can feed it a URL and get back the source (page) to do with as you will. The MSDN articles that come up of you google httpwebrequest will help you. ah! someone gave me the answer!

[chrome recently applied](https://www.kevel.co/blog/chrome-samesite/) a new default of " lax " to the " samesite " parameter of cookies. lax was not lax enough; i needed to set samesite=none .

added to [localsettings.php of mediawiki](https://www.mediawiki.org/wiki/manual:%24wgcookiesamesite):

$wgcookiesamesite='none';

thanks!!

​ It doesn't matter what code editor you use for your website, it depends upon the language you use. Visual Studio is good enough for C, C++, C#, Visual Basic, ASP.net, etc. It isn't good for php.


It makes the work of a programmer easier with all its embedded features. it is an design based code editor. That is why I like it. Dreamweaver on the other hand, gives me a chance to learn the codes thoroughly, since it does not come with ready made help plugins and designing features as such. you put the code i’ve given to layouts/\_default/\_markup/render-image.html and it executes for every image you have in your markdown. that’s what \_markup render-hooks are for. for example, you can disable right click on images at your page:

```

$(document).ready(function() {
    $("img").on("contextmenu",function(){
       return false;
    }); 
}); 

```