Programovacie jazyky, rady, poradňa...
-
Rech25
Light Expert
- Príspevky: 71
- Registrovaný: 13 feb 2010, 22:32
Príspevok
od používateľa Rech25 »
Potreboval by som nasledujúci prvok presne na stred stránky.
Kód: Vybrať všetko
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script>
function closeCommercial()
{
$('#navigation').addClass('none');
}
</script>
<style>
html, body {
height: 100%;
}
body {
position: relative;
}
#container, #navigation {
position: relative;
}
#container {
min-height: 100%;
font: normal 1em/1.5em arial, helvetica, sans-serif;
}
* html #container {
height: 100%;
}
#navigation {
width: 0px;;
background-color: #fffff;
border-top: 0px solid #fff;
position: fixed;
bottom: 0;
left: 0;
right: 0;
z-index: 1000;
padding: 0px 0px 0px 0px;
}
* html #navigation {
position: absolute;
width: 2px;/*IE5.5*/
bottom: 2;
left: 2;
padding: 2px 2px 2px 2px;
overflow: visible;
top: expression(eval(document.compatMode document.compatMode=='CSS1Compat') ? documentElement.scrollTop +(documentElement.clientHeight-this.clientHeight) : document.body.scrollTop +(document.body.clientHeight-this.clientHeight));
}
* html .close
{
left: 0px;
}
.close
{
position: absolute;
left: 683px;
top: 8px;
border: none;
z-index: 1000;
}
.none
{
display: none;
}
</style>
Aký atribút musím upraviť, tak aby sa jednak banner vycentroval ale aj atribut .close
Dakujem
-
PhYs0c
King
- Príspevky: 1612
- Registrovaný: 17 apr 2009, 21:56
- Bydlisko: Nitra
-
Kontaktovať používateľa:
Príspevok
od používateľa PhYs0c »
{margin: auto;}

-
Rech25
Light Expert
- Príspevky: 71
- Registrovaný: 13 feb 2010, 22:32
Príspevok
od používateľa Rech25 »
PhYs0c napísal:{margin: auto;}

môžeš napísať, kde to mám dať. Najlepšie daj celý kód. Dík
-
PhYs0c
King
- Príspevky: 1612
- Registrovaný: 17 apr 2009, 21:56
- Bydlisko: Nitra
-
Kontaktovať používateľa:
Príspevok
od používateľa PhYs0c »
ved do toho co chces vycentrovat, ak chces vycentrovat div lama tak:
#lama
{margin: auto;}
a html
<div id="lama">
xxx
</div>
-
Rech25
Light Expert
- Príspevky: 71
- Registrovaný: 13 feb 2010, 22:32
Príspevok
od používateľa Rech25 »
a nemozes napisat rovno ten kod. Lebo ja som napisal kod kde potrebujem vycentrovat banner ktory sa zobrazi a neviem ktora cast to je.
-
Numline1
Light Professional
- Príspevky: 858
- Registrovaný: 04 dec 2006, 18:04
Príspevok
od používateľa Numline1 »
Kód: Vybrať všetko
<div id="commercial">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script>
function closeCommercial()
{
$('#navigation').addClass('none');
}
</script>
</div>
<style>
html, body {
height: 100%;
}
body {
position: relative;
}
#commercial {
margin: auto;
}
#container, #navigation {
position: relative;
}
#container {
min-height: 100%;
font: normal 1em/1.5em arial, helvetica, sans-serif;
}
* html #container {
height: 100%;
}
#navigation {
width: 0px;;
background-color: #fffff;
border-top: 0px solid #fff;
position: fixed;
bottom: 0;
left: 0;
right: 0;
z-index: 1000;
padding: 0px 0px 0px 0px;
}
* html #navigation {
position: absolute;
width: 2px;/*IE5.5*/
bottom: 2;
left: 2;
padding: 2px 2px 2px 2px;
overflow: visible;
top: expression(eval(document.compatMode document.compatMode=='CSS1Compat') ? documentElement.scrollTop +(documentElement.clientHeight-this.clientHeight) : document.body.scrollTop +(document.body.clientHeight-this.clientHeight));
}
* html .close
{
left: 0px;
}
.close
{
position: absolute;
left: 683px;
top: 8px;
border: none;
z-index: 1000;
}
.none
{
display: none;
}
</style>
Jedna z moznosti...