iT邦幫忙

0

網頁高寬設100%怎麼還會超過螢幕呢 ?

100%的意思是充滿整個螢幕嗎 ? 但怎麼還會超過螢幕呢 ?

<%@ Master Language="VB" CodeFile="MasterPage3.master.vb" Inherits="MasterPage3" %>

<html xmlns="http://www.w3.org/1999/xhtml">

<iframe src="http://localhost/website4/images/首頁.swf"
style="height: 100%; width: 100%"></iframe>

<head runat="server">
<title></title>
<asp:ContentPlaceHolder id="head" runat="server">
</asp:ContentPlaceHolder>

ccutmis iT邦高手 2 級 ‧ 2012-01-13 14:25:34 檢舉
<body>....</body>
<head>....</head>

body標籤怎麼會是在head前面? Orz
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

1 個回答

4
wiseguy
iT邦超人 1 級 ‧ 2012-01-13 14:24:46
最佳解答
  1. HTML 的屬性本來就是<參考>性質 (給 render 參考用的),所以不保證你設什麼就是什麼 (width=300 的 table 放張 width=400 的圖進去,table 就撐成 400了對吧)

  2. 你的 100% 是設給 iframe 這個 element,下面還有一個 container:body。body 也有 margin 屬性,預設不為零。所以 n > 0, 且 n + 100% 當然就 > 100% 。

試試 改為 <body style="margin: 0">
<iframe> 多加一個 FRAMEBORDER="0"

看更多先前的回應...收起先前的回應...

謝謝妳的回答 , 改成下面這樣對嗎 ?
但還是會超過

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<asp:ContentPlaceHolder id="head" runat="server">
</asp:ContentPlaceHolder>

<body style="margin:0">
<iframe src="http://localhost/website4/images/首頁.swf"
style="height: 100%; width: 100%" frameborder="0"></iframe>

tonychen168提到:
首頁.swf

可能就超過100%了

newkevin iT邦高手 1 級 ‧ 2012-01-13 16:21:05 檢舉

先不要用% 直接設多大 看到底有沒有超過 600 800 1000 先找到原因

我改成 1280 * 800 但是上下都會出現一些空白

<body align="center">
<form id="form1" runat="server">
<div >
<embed src="Images/首頁.swf" width="1280" height="800" wmode="transparent" />
</div>

</form>

我下面這行置中, 但卻沒有置中
<body align="center">

wiseguy iT邦超人 1 級 ‧ 2012-01-13 18:00:38 檢舉

body 並沒有 align 這個 property,當然會沒用。
改成 <body style="text-align: center">

我要發表回答

立即登入回答