Opening a New Window with Custom Dimensions in HTML for Target="_blank"
When using target="_blank" in HTML to open a new window, users may face limitations in setting specific dimensions. In this scenario, JavaScript can be leveraged to provide a customizable solution.
To create a new window with specified width and height, use the following code:
<code class="html"><a href="http://www.facebook.com/sharer" onclick="window.open(this.href, 'mywin', 'left=20,top=20,width=500,height=500,toolbar=1,resizable=0'); return false;">Share this</a></code>
The window.open() method takes several parameters:
By adjusting these parameters, you can create a custom window that opens on a new page with the desired dimensions.
The above is the detailed content of How to Customize Window Dimensions When Using target=\'_blank\' in HTML?. For more information, please follow other related articles on the PHP Chinese website!