Thread: XML with CSS

    #1
  1. No Profile Picture
    //PHP Master-in-Training
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2002
    Location
    127.0.0.1
    Posts
    10
    Rep Power
    0

    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. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2001
    Posts
    28
    Rep Power
    0
    show us?
  4. #3
  5. No Profile Picture
    //PHP Master-in-Training
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2002
    Location
    127.0.0.1
    Posts
    10
    Rep Power
    0
    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
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Nov 2001
    Posts
    765
    Rep Power
    14
    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/
  8. #5
  9. No Profile Picture
    //PHP Master-in-Training
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2002
    Location
    127.0.0.1
    Posts
    10
    Rep Power
    0
    nope that didn't work. i set maintable { position: relative; } and it still didn't work.

IMN logo majestic logo threadwatch logo seochat tools logo