iFrame v centura

3 отговора 143 прегледа
#1

iFrame v centura

Kak da centriram edin iFrame ne samo v centura na stranicata schitano liavo-diasno, no i v centura schitano gore-dolu. Mai tova se narichashe absolute middle ili neshto podobno, ne pomnia tochno.

Mersi!

p.s. Izvinete me za latinicata

Отговор
в отговор на e-smile #2

Re: iFrame v centura

таблица с 100% дължина, клетка с 100% височина и да има align=center и valign=middle

Отговор
в отговор на e-smile #3

Re: iFrame v centura

С position absolute:


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"[линк]">

<html lang="bg" xml:lang="bg" xmlns="[линк]">
<head>
<meta http-equiv="content-type" content="text/html; charset=windows-1251" />
<meta http-equiv="content-language" content="bg" />
<style type="text/css" media="all">
html,body{height:100%;margin:0;}
#fr,#iframe{width:200px;height:200px;}
#fr{margin:-100px auto 0;position:relative;top:50%;border:1px solid blue;}
</style>
<title>Title</title>
</head>
<body>

<div id="fr"><iframe id="iframe" src="[линк]" /></div>

</body>
</html>





С position relative:


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"[линк]">

<html lang="bg" xml:lang="bg" xmlns="[линк]">
<head>
<meta http-equiv="content-type" content="text/html; charset=windows-1251" />
<meta http-equiv="content-language" content="bg" />
<style type="text/css" media="all">
html,body{height:100%;margin:0;}
#fr,#iframe{width:200px;height:200px;}
#fr{margin:-100px 0 0 -100px;position:relative;top:50%;left:50%;border:1px solid blue;}
</style>
<title>Title</title>
</head>
<body>

<div id="fr"><iframe id="iframe" src="[линк]" /></div>

</body>
</html>




Избери си

[линк] - блог, уеб дизайн, лекции, интернет сигурност

Редактирано от dimodi на

Отговор
в отговор на dimodi #4

Re: iFrame v centura

Mersi mnogo. Tochno tova iskah :-)

Отговор