Problem with html attribute width=100%
-
Hello, I would like to put a panel at the top of my web page which spans the entire width of the page. Here is the code I have: <asp:Panel id="Panel1" style="Z-INDEX: 102; LEFT: 0px; POSITION: absolute; TOP: 0px" runat="server" Width="100%" Height="48px" Wrap="False"> </asp:Panel> For some reason, when this is rendered in IE, it leaves a quarter inch of space on the right side near the vertical scroll bar. If I set the width=110%, it spans the entire screen, but then a horizontal scroll bar appears. Is there any particular reason this is happening? The same thing happens when I set other objects to have a width of 100% (ex. horizontal rule, table, etc). How do I get rid of this problem? Thanks for your help, RC
-
Hello, I would like to put a panel at the top of my web page which spans the entire width of the page. Here is the code I have: <asp:Panel id="Panel1" style="Z-INDEX: 102; LEFT: 0px; POSITION: absolute; TOP: 0px" runat="server" Width="100%" Height="48px" Wrap="False"> </asp:Panel> For some reason, when this is rendered in IE, it leaves a quarter inch of space on the right side near the vertical scroll bar. If I set the width=110%, it spans the entire screen, but then a horizontal scroll bar appears. Is there any particular reason this is happening? The same thing happens when I set other objects to have a width of 100% (ex. horizontal rule, table, etc). How do I get rid of this problem? Thanks for your help, RC
This is a stylesheet problem. You should set the padding to 0 and possibly the margin to 0. This has to do with the box format that CSS uses. So, to your
style
attribute addpadding:0px;margin:0px
.-----BEGIN GEEK CODE BLOCK----- Version: 3.21 GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++ -----END GEEK CODE BLOCK-----
-
Hello, I would like to put a panel at the top of my web page which spans the entire width of the page. Here is the code I have: <asp:Panel id="Panel1" style="Z-INDEX: 102; LEFT: 0px; POSITION: absolute; TOP: 0px" runat="server" Width="100%" Height="48px" Wrap="False"> </asp:Panel> For some reason, when this is rendered in IE, it leaves a quarter inch of space on the right side near the vertical scroll bar. If I set the width=110%, it spans the entire screen, but then a horizontal scroll bar appears. Is there any particular reason this is happening? The same thing happens when I set other objects to have a width of 100% (ex. horizontal rule, table, etc). How do I get rid of this problem? Thanks for your help, RC
Sounds like you've got the default padding on the page. Add
html,body { padding: 0; margin: 0 }
to your stylesheet and you should be good to go. - Mike -
Hello, I would like to put a panel at the top of my web page which spans the entire width of the page. Here is the code I have: <asp:Panel id="Panel1" style="Z-INDEX: 102; LEFT: 0px; POSITION: absolute; TOP: 0px" runat="server" Width="100%" Height="48px" Wrap="False"> </asp:Panel> For some reason, when this is rendered in IE, it leaves a quarter inch of space on the right side near the vertical scroll bar. If I set the width=110%, it spans the entire screen, but then a horizontal scroll bar appears. Is there any particular reason this is happening? The same thing happens when I set other objects to have a width of 100% (ex. horizontal rule, table, etc). How do I get rid of this problem? Thanks for your help, RC
One other thing that you might want to try is setting the rightmargin attribute of your body tag to "0". HTH, Bill P. Oakland, CA