Új hozzászólás Aktív témák
-
tildy
nagyúr
válasz pumatom #3511 üzenetére
cssel:
<style type="text/css">
#outer {height: 400px; overflow: hidden; position: relative; width: 100%;}
#outer[id] {display: table; position: static;}
#middle {position: absolute; top: 50%; width: 100%; text-align: center;} /* for explorer only*/
#middle[id] {display: table-cell; vertical-align: middle; position: static;}
#inner {position: relative; top: -50%; text-align: left;} /* for explorer only */
#inner {width: 200px; margin-left: auto; margin-right: auto;} /* for all browsers*/
/* optional: #inner[id] {position: static;} */
/* just format */
div.greenBorder {border: 1px solid green; background-color: ivory;}
</style>
</head>
<body>
<h1>Vertical and horizontal centering in valid CSS - Example</h1>
<div id="outer" class="greenBorder">
<div id="middle">
<div id="inner" class="greenBorder">
any text<br>
<b>any height, set width,</b><br>
any content, for example generated from DB<br>
everything is both vertically and horizontally centered<br>
</div>
</div>
</div>"Tartsd magad távol azoktól, akik le akarják törni az ambíciódat! A "kis" emberek mindig ezt teszik, de a nagyok éreztetik veled, hogy te is naggyá válhatsz" - Mark Twain
Új hozzászólás Aktív témák
- WoW avagy World of Warcraft -=MMORPG=-
- Házimozi haladó szinten
- Milyen TV-t vegyek?
- Honda topik
- No Voice in the Galaxy
- gban: Ingyen kellene, de tegnapra
- KERÉKPÁR / BRINGA / ALKATRÉSZ beárazás
- Call of Duty: Modern Warfare III (2023)
- VR topik (Oculus Rift, stb.)
- Poco X6 Pro - ötös alá
- További aktív témák...