作者 主題: 請問要如何設定在不同的顯示器上自動調整版面大小?  (閱讀 5179 次)

0 會員 與 1 訪客 正在閱讀本文。

NARs

  • 活潑的大學生
  • ***
  • 文章數: 227
    • 檢視個人資料
請問各位大大,
我的頁面在PC和NB上的顯示會有版面不一樣的問題,例如,top.php(呈現logo)在PC上和NB上的顯示不一樣,在PC上是很正常,可是在NB上會沒有完整呈現logo,如果去調整比例,又會變成PC上看起來比例不對,請問這要怎麼解決?

代碼: [選擇]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>home</title>
<link href="style.css" rel="stylesheet" type="text/css" />

</head>


 <frameset rows="10%,*" cols="*" frameborder="0" >
    <frame src="top.php" name="top" scrolling="no" />
    <frameset rows="*" cols="210px,*">
      <frame src="left.php" name="left" noresize scrolling="no" />
      <frame src="content.php" name="center" noresize scrolling="no"/>
    </frameset>
    <noframes></noframes>
   

<body>
</body>
</html>

Yamaka

  • 俺是博士!
  • *****
  • 文章數: 4913
    • 檢視個人資料
    • http://www.ecmagic.com
請問各位大大,
我的頁面在PC和NB上的顯示會有版面不一樣的問題,例如,top.php(呈現logo)在PC上和NB上的顯示不一樣,在PC上是很正常,可是在NB上會沒有完整呈現logo,如果去調整比例,又會變成PC上看起來比例不對,請問這要怎麼解決?

代碼: [選擇]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>home</title>
<link href="style.css" rel="stylesheet" type="text/css" />

</head>


 <frameset rows="10%,*" cols="*" frameborder="0" >
    <frame src="top.php" name="top" scrolling="no" />
    <frameset rows="*" cols="210px,*">
      <frame src="left.php" name="left" noresize scrolling="no" />
      <frame src="content.php" name="center" noresize scrolling="no"/>
    </frameset>
    <noframes></noframes>
   

<body>
</body>
</html>

用 js 抓螢幕解析度(screen.width)再設定大小

參考這裡:
http://www.w3schools.com/jsref/prop_screen_width.asp