SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Addict
    Join Date
    Jul 2008
    Posts
    255
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Positioning DIV within a DIV

    Hi,
    I am trying to change the position of a DIV within a DIV, but the logo DIV is seems to always stay in the same postion, can somebody take a look at the attached code and advise me ?

    many thanks

    Code:
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Untitled Document</title>
    <script type="text/javascript" src="swfobject.js"></script>
    <script type="text/javascript" src="jquery-latest.js"></script>
    <script type="text/javascript" src="thickbox.js"></script>
    <style type="text/css">
    <!--
    
    .main {
    	position:absolute;
    	left:100px;
    	top:100px;
    	height:500px;
    }
    
    .logo {
    	position:relative;
    	left:100px;
    	top:100px;
    }
    
    
    --!>
    </style>
    </head>
    
    <body>
    <div id="main">
    
    <div id="logo"></div>
    <script type="text/javascript">
       var so = new SWFObject("swf/logo9ie.swf", "mymovie", "350", "70", "8");
       so.write("logo");
    </script>
    
    
    </div>
    </body>
    </html>

  2. #2
    SitePoint Wizard
    Join Date
    Oct 2005
    Location
    London
    Posts
    1,678
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    to access an id in css you use #....like so:
    Code CSS:
    #main {
    	position:absolute;
    	left:100px;
    	top:100px;
    	height:500px;
    }
     
    #logo {
    	position:relative;
    	left:100px;
    	top:100px;
    }

    .selector accesses an element with a class


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •