Autor | Zpráva | ||
---|---|---|---|
ondra15 Profil |
#1 · Zasláno: 19. 7. 2011, 21:59:03 · Upravil/a: ondra15
Ahoj, mám problém. Mám web, široký 1000px (jeho obsah). Tomu obsahu chci dát po stranách stínění (přes obrázek). Ten obrázek stínění tam vložím přes
position: absolute Kód: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> ...... <body> <div id="head"> <div class="in"> <img src="/images/background/main_header.png" width="1000" height="217" border="0"> </div> <div id="shadow-left"> <img src="/images/background/main_header_shadow_left.png" width="40" height="345" border="0"> </div> <div id="shadow-right"> <img src="/images/background/main_header_shadow_right.png" width="40" height="345" border="0"> </div> <div id="content-center"> </div> </div> </body> </html> CSS: html { padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin: 0; border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; } body { background: #003251 url('/images/background/bg_top_gradient.png') repeat-x 50% 0%; line-height: 1.4; font-family: Tahoma, Verdana, Arial, lucida, sans-serif; font-size: small; text-align: center; } a { color: #4D76AA; } a:hover { text-decoration: none; } #head { text-align: center; margin: 0 auto; } #head .in { overflow: hidden; margin: 0 auto; } #shadow-left { position: absolute; top: 0px; left: 100px; } #shadow-right { position: absolute; top: 0px; right: 100px; } #content-center { text-align: center; margin: 0 auto; background: #fff; width: 1000px; height: 400px; } Předem díky, O. |
||
joe Profil |
#2 · Zasláno: 20. 7. 2011, 00:58:00
Kde máš position: relative; u nějakého rodiče stínu? Nastuduj si něco o pozicování a jak s ním správně pracovat. Stejně tak o samotném CSS
padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; je možné napsat jako padding: 0; |
||
Časová prodleva: 13 let
|
0