|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
XML with CSS
ok i got a XML page that includes a CSS document for formatting and all the colors and fonts work fine but for some reason 'position: absolute' doesn't work. i have tried many things but it just won't work. does anyone know why this is or a way to get around it?
|
|
#2
|
|||
|
|||
|
show us?
|
|
#3
|
|||
|
|||
|
page.xml
Code:
<?xml version="1.0"?> <?xml-stylesheet type="text/css" href="page.css"?> <page> <header>Outburst Online</header> <maintable> <sidemenu> <item>Hello</item> <item>Waz ^?</item> <item>N/M Here</item> </sidemenu> <content> <datetable> <greet> Hello Guest </greet> <date> March, 29 2002 </date> </datetable> <news> News Goes Here </news> <copyright> Site Copyright 2002 Travis Watkins </copyright> </content> </maintable> </page> page.css Code:
page {
border: 2px solid #000000;
background-color: #598CD0;
margin: 0px;
width: 100%;
height: 100%;
}
header {
font-family: Verdana, Arial;
font-size: 25px;
color: #000000;
}
item {
display: block;
font-family: Verdana, Arial;
font-size: 12px;
color: #FFFFFF;
}
sidemenu {
display: block;
padding: 3px;
background-color: #002D6B;
border: 2px solid #000000;
width: 120px;
height: 95%;
}
news {
display: list-item;
padding: 3px;
background-color: #76B0FF;
font-size: 12px;
font-family: Verdana, Arial;
position: absolute:
top: 20px;
left: 120px;
}
datetable {
display: none;
width: 100%;
background-color: #AAAAAA;
padding: 3px;
border-top: 2px solid #000000;
border-bottom: 2px solid #000000;
}
greet {
display: table-cell;
width: 50%;
font-family: Verdana, Arial;
font-size: 12px;
}
date {
display: table-cell;
text-align: right;
width: 50%;
font-family: Verdana, Arial;
font-size: 12px;
}
copyright {
font-size: 12px;
text-align: center;
font-family: Verdana;
padding: 3px;
}
it puts everything under the menu instead of next to it |
|
#4
|
|||
|
|||
|
An element's CSS position is always relative to something else; it's often the next outer element in the containment (element hierarchy) that itself is positioned. If no containing elements are positioned, the window itself becomes the positioning context. If you want an element positioned relative to another element it's nested within, set the outer element to position:relative - this sets up a new positioning context for nested elements, while leaving the outer element in the 'flow'; then set the nested element to position:absolute, and trim its position (relative to its offset parent) with left & top. This entire subject can be very confusing.
http://www.webreference.com/html/tutorial18/ |
|
#5
|
|||
|
|||
|
nope that didn't work. i set maintable { position: relative; } and it still didn't work.
|
![]() |
| Viewing: Dev Shed Forums > Web Design > CSS Help > XML with CSS |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|