문제

How can I center the whole iframeset??

<html>
<head>
<style>
</style>
</head>
<frameset rows="100,*" frameborder="0" border="0" framespacing="0">
  <frame name="topNav" src="banner.php">
<frameset cols="200,*" frameborder="0" border="0" framespacing="0">
    <frame name="menu" src="menu.php" marginheight="0" marginwidth="0" scrolling="auto" noresize>
    <frame name="content" src="dashboard.php" marginheight="0" marginwidth="0" scrolling="auto" noresize>

</frameset>
</frameset>
</html>

I tried <div> and applying text-align:center; But It didnt work? !

도움이 되었습니까?

해결책 2

replace your frameset tags with these,

<frameset class="center" rows="100,*" frameborder="0" border="0" framespacing="0">
<frameset class="center" cols="200,*" frameborder="0" border="0" framespacing="0">

Addthese css codes for the page

.center
{
margin-left:auto;
margin-right:auto;
width:70%;
}

다른 팁

You are either going to have to create a frame on the left and right sides, or just create an iframe and avoid the whole issue (better option). frameset is obsolete so you should avoid using it.

Declare the width of the div and apply:

margin:auto;

or

margin-left:auto;
margin-right:auto;

Working Sample

Additionally, please avoid using frameset in the future! It is obsolete in HTML5.

Cheers!

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top