Ú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>
Új hozzászólás Aktív témák
- Dell Latitude 5420 - i5 1145G7 ,16-32GB RAM, SSD, jó akku, számla, 6 hó gar
- Eladó retro HiFi-k és erösítők/hangfalak
- Apple Watch Series 10 42mm Jet Black 96% (1év Garancia)
- GYÖNYÖRŰ iPhone 12 Mini 64GB Black -1 ÉV GARANCIA - Kártyafüggetlen, MS4167, 94% Akksi
- VeryBig! Akciós! Dell Precision 7760 i7-11850H 32GB 512GB SSD RTX A5000 16GB 17" FHD 1 év garancia
Állásajánlatok
Cég: Laptopműhely Bt.
Város: Budapest
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest

