Click here to Skip to main content
15,886,518 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hai everyone
How to set full page .i.e width and height 100% without appear scroll bar. Don't consider address bar only.my need is website appear in full page in all browser including ie8 and also in all screen resoultions,pls give some sample code ,like full page background color ok,no need to put controls,just full page background enough but scroll bar not appear without consider address bar only,if search bar,tool bar is there scroll bar can appear.

This is my code,but color not appear in full page,if i set height as pixel can appear but small white space is appear bottom of page when i test in different browsers.

May be use java script to calculate width and height of inner browser and set to a page using java script at run time.
ASP.NET
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml" style="height: 100%;">
<head runat="server">
    <title></title>
</head>
<body style ="margin :0px; height :100%" >
    <form id="form1" runat="server" >
    <div style="height: 100%;">
    
    <table width="100%"  border="0" cellpadding="0" cellspacing="0"  style ="background-color :red">
            <tr>
                <td> </td>
                <td> </td>
                <td> </td>
            </tr>
            <tr>
                <td> </td>
                <td> </td>
                <td> </td>
            </tr>
            <tr>
                <td> </td>
                <td> </td>
                <td> </td>
            </tr>
        </table>
    
    </div>
    </form>
</body>
</html>


pls reply asap
Thanx
Aravind
Posted
Updated 13-Jun-13 20:05pm
v3
Comments
Mohibur Rashid 14-Jun-13 4:57am    
just set the table height 100%
Aravindba 14-Jun-13 6:04am    
where i set ? in html tag or body tag or diz tag ? where where ?

1 solution

Hello Arvind,
Use following code to get complete (full height and width) background color of your page
XML
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8" />
    <title></title>
    <style type="text/css">
        html {
            margin: 2px;
            padding: 0;
        }

        body {
            font-size: .85em;
            font-family: "Segoe UI", Verdana, Helvetica, Sans-Serif;
            margin: 0;
            padding: 0;
            background-color:gray;
            width:100%;
            height:100%;
        }
    </style>
</head>
<body>
</body>
</html>
 
Share this answer
 
Comments
Aravindba 16-Jun-13 23:39pm    
Hi thank u for ur reply,
This will work fine,i need more one.i use master page in my website,in single page it work ,but if i use master page how i use this code ? ,can u tell me same like i want but i use master page concept i.e in child page i want this same appear.can u change this code in master page and how i get in child page.
pls reply asap

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900