Filling the Web page with a splitter

To create the feel of a desktop application, you may want to have a splitter control fill the entire Web page. To
do this, you must obviously set the Widthand Heightproperties of the splitter to "100%". However, if you just
set those properties and run your application, you may encounter some unexpected behavior. For example, you
may find the splitter with a height of 0!
To achieve the expected behavior, you need to make some changes to the tags that Visual Studio automatically
adds to the aspx file:
1. On the <html>tag, set the styleattribute to give the document a height of 100%:
style="height:100%".
2. On the <body>tag, you must again set the styleattribute to include a height of 100%. In addition, the
style attribute must reset the margin. The default margin of the body is 5 pixels, and you will want to
change this to 0. Optionally, you may also want to remove the page scroll bars for a more desktop-like
feel. Putting these changes together gives the tag:
<body style="height:100%;margin:0px" scroll="no">
3. Any elements that contain the splitter must also have their height set to 100% and their margin set to 0.
This includes the <form>tag:
<form id="form1" runat="server" style="height:100%;margin:0px">
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值