Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Problem with html attribute width=100%

Problem with html attribute width=100%

Scheduled Pinned Locked Moved Web Development
helpquestionhtmldatabasesysadmin
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    chubbysilk
    wrote on last edited by
    #1

    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

    H Z B 3 Replies Last reply
    0
    • C chubbysilk

      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

      H Offline
      H Offline
      Heath Stewart
      wrote on last edited by
      #2

      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 add padding: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-----

      1 Reply Last reply
      0
      • C chubbysilk

        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

        Z Offline
        Z Offline
        ZoogieZork
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        • C chubbysilk

          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

          B Offline
          B Offline
          Bill Priess
          wrote on last edited by
          #4

          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

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups