Results 1 to 8 of 8

Thread: Positioning in CSS

  1. #1
    Join Date
    Oct 2008
    Posts
    22
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default Positioning in CSS

    Hi there,

    I am trying to position an image (logo) the to the right of the logo I would like some text links.

    I have used the - number in the margin so that my links would move up and show next to my logo. However, I have been told this will not work in some browsers and only work in IE. How can I code the css so it works in all browsers? I have included the code bellow. Thank you in advance for any help.

    CSS For the image and navigation:

    Code:
    #container {
    	width: 800px;
    	margin-bottom: 10px;
    	margin-left: auto;
    	margin-right: auto;
    }
    
    /* ----------logo-------------- */
    #banner {
    	text-align: left;
    	padding: 0px;
    	margin: 0px;
    }
    /* -----------menu1--------------------------- */
    #navigation {
    	text-align: center;
    	margin: -47px 0px 0px 263px;
    	width:505px;
    	height:33px;
    	padding: 0px;
    	background-color:#0099FF;
    }
    .nav1{
    	width: 100%;
    	overflow: hidden;
    	color:#FFFFFF;
    }
    .nav1 ul{
    	margin: 0;
    	padding: 0;
    	padding-left: 10px; /*offset of tabs relative to browser left edge*/
    	font: bold 16px Verdana;
    	list-style-type: none;
    }
    .nav1 li{
    	display: inline;
    	margin: 0;
    }
    .nav1 li{
    	float: left;
    	display: block;
    	text-decoration: none;
    	margin: 0;
    	padding: 7px 16px; /*padding inside each tab*/
    	color: #000000;
    }
    .nav1 li a:visited{
    	color: #000000;
    }
    .nav1 li a:hover{
    	color: #FFFFFF;
    }
    HTML Code:
    <body>
    <div id="container">
    <div id="banner" ><img src="raglanfestlogo.gif" width="263" height="139" /></div>
    <div id="navigation" class="nav1">
    <ul>
    <li><a href="http://www.raglan-festival.org">About</a></li>
    <li><a href="http://www.raglan-festival.org">Contact</a></li>
    <li><a href="http://www.raglan-festival.org">Schedule</a></li>
    <li><a href="http://www.raglan-festival.org">Sponsors</a></li>
    <li><a href="http://www.raglan-festival.org">Links</a></li>
    </ul>
    <div id="rightcornerbox"><img src="rightcorner.gif" /></div>
    </div>
    rest of page
    </div>
    Last edited by Snookerman; 04-22-2009 at 08:55 AM. Reason: added [code] and [html] tags and “Resolved” prefix

  2. #2
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    Don't quite follow what you are after. Do you have a link to the page or an image to help illistrate what you want done?
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  3. #3
    Join Date
    Oct 2008
    Posts
    22
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    I am trying to re-code this site in css

    www.raglan-festival.org

    I am having trouble with the menu bars at the top of the page. I basicaly want to know how to get the menu in that possition and be cross browser compatible.

    I have used the code above and #navigation is where the top menu is held but to get it to show next to the image i used the code margin: -47 0 0 0;

    However in some browsers i have been told the -47 will not work.

    How can i do the image and menu in css relative positioning?

    Hope this helps....its a difficult one to explain.

    Thank you for taking the time to help.

  4. #4
    Join Date
    Oct 2008
    Location
    Sweden
    Posts
    2,023
    Thanks
    17
    Thanked 319 Times in 318 Posts
    Blog Entries
    3

    Default

    Can you post a link to the new page, or attach it here? It would make it easier to help you.

  5. #5
    Join Date
    Oct 2008
    Posts
    22
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    I have attached the files.

    Any problems let me know.

    Thank you

  6. #6
    Join Date
    Oct 2008
    Posts
    22
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    the html in a txt document

  7. #7
    Join Date
    Sep 2008
    Location
    Bristol - UK
    Posts
    842
    Thanks
    32
    Thanked 132 Times in 131 Posts

    Default

    I haven't looked through your code, but I've found relative positioning can be a pain, in IE sometimes images / text will stay in the same place when the window is resized. In most cases I usually try and take out the position relative, and try using floats with different values for the margin, as I've found this the best solution, give it a try.

  8. #8
    Join Date
    Oct 2008
    Location
    Sweden
    Posts
    2,023
    Thanks
    17
    Thanked 319 Times in 318 Posts
    Blog Entries
    3

    Default

    Have you fixed the problem yet (it looks fine with me)? If so, ad the Resolved prefix by editing your first post.

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
  •