www.webdeveloper.com
Recent Articles
  • Finding Slow Running Queries in ASE 15
  • A More Advanced Pie Chart for Analysis Services Data
  • Adobe AIR Programming Unleashed: Working with Windows
  • Performance Testing SQL Server 2008's Change Data Capture Functionality
  • The ABC's of PHP: Introduction to PHP
  • How to Migrate from BasicFiles to SecureFiles Storage
  • Why the Twitter Haters Are Wrong
  • User Personalization with PHP: Beginning the Application
  • Whats in an Oracle Schema?
  • Lighting Enhancement in Photoshop
  •  

    Go Back   WebDeveloper.com > Client-Side Development > CSS

    CSS Discussion and technical support relating to Cascading Style Sheets.

    Reply
     
    Thread Tools Search this Thread Rate Thread Display Modes
      #1  
    Old 11-04-2009, 11:00 AM
    ron11612002 ron11612002 is offline
    Registered User
     
    Join Date: Oct 2009
    Posts: 6
    CSS positioning images and nav menus.

    hello,

    I'm creating a corporate website as a school project and I have questions about positioning my images and texts on the web page. here is an example of text i"m trying to put on top in the navigation bar. first the source code:
    <div id="Logo">

    <h1> Alpert's Newspaper Delivery </h1>

    </div> <!-- end of logo -->

    second the css for the Logo:

    #Logo h1 {float:right;
    font-family:"Times New Roman", Times, serif;
    font-style:italic;
    padding-right:20px;
    font-size:36px;
    color:#F00;
    text-decoration:underline}

    I want to put the image in the navigation bar on the right side.

    Here's the source code for the navigation bar:

    #headercontainer{height:24px;background:#000;display:block;padding:45px 0 0 15px;}
    #headermenu{position:relative;display:block;height:24px;font-size:16px;font-weight:bold;font-family:Arial,Verdana,Helvitica,sans-serif;}
    #headermenu ul{margin:0px;padding:0;list-style-type:none;width:auto;}
    #headermenu ul li{display:block;float:left;margin:0 1px 0 0;}
    #headermenu ul li a{display:block;float:right; clear:both; color:#FFF;text-decoration:none;padding:5px 20px 0px 20px;height: 19px;background: transparent url(../images/foxmenu_bg-OFF.gif) no-repeat top left;}
    #headermenu ul li a:hover{color:#fff;background:transparent url(images/foxmenu_bg-OVER.gif); background-repeat:repeat-x}
    #headermenu ul li a.current,#headermenu ul li a.current:hover{color:#000;background:#fff}


    Here is the navigation source code using divs:


    <div id="headercontainer">



    <div id="headermenu">

    <ul>

    <li><a href="" title=""> Home</a></li>
    <li><a href="" title=""> About Us</a></li>
    <li><a href="" title="" class="current"> Services</a></li>
    <li><a href="" title=""> Owners</a></li>
    <li><a href="" title=""> Advantages</a></li>
    <li><a href="" title=""> Publications</a></li>
    <li><a href="" title=""> Mission Statement</a></li>

    </ul>

    </div><!--End of headermenu-->


    </div> <!--end of headercontainer-->


    Now keep in mind, I got this nav menu from another website. Is there anyway i can modify it to have my logo appear in the top right of this nav menu.

    The navigation menu has a black background with red buttons. Should I extend the height of the nav bar and then vertical-align:top the logo. This didn't seem to work. Also is there anyway I can post a screenshot of my home page.

    Thanks
    Ron
    Reply With Quote
      #2  
    Old 11-04-2009, 01:04 PM
    kaafmim's Avatar
    kaafmim kaafmim is offline
    Registered User
     
    Join Date: Nov 2009
    Posts: 32
    If I get it right, you want to put the Logo div inside headermenu. So first of all you should put the logo inside this div. I see the li tags are all right floated; So, to put your logo on the right side, you should right align in (via putting a float:right; in its style definition). And to have it on the right end of the block, you should put it before the ul tag.

    The first problem with your code is that you try to right align the logo h1, this won't help, as h1 is an inline element, so it can't be floated. You should do something like this:

    Code:
    ...
    <style>
    
    #logo { float:right; }
    
    #logo h1 {
    ...
    
    </style>
    
    ...
    
    <div id="headermenu">
    
      <div id="logo">....</div>
    
      <ul>
        <li><a href="" title=""> Home</a></li>
    ...
    But as this doesn't seem like a clean source to me, I suggest you modify the source code of the header, or if you are not so easy with html and css, pick a navigator from somewhere else.
    Reply With Quote
      #3  
    Old 11-04-2009, 03:17 PM
    ron11612002 ron11612002 is offline
    Registered User
     
    Join Date: Oct 2009
    Posts: 6
    Thanks a lot. It worked.
    Reply With Quote
    Reply

    Bookmarks


    Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
     
    Thread Tools Search this Thread
    Search this Thread:

    Advanced Search
    Display Modes Rate This Thread
    Rate This Thread:

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is Off
    HTML code is Off
    Forum Jump


    All times are GMT -5. The time now is 11:42 PM.



    Acceptable Use Policy

    internet.comMediabistrojusttechjobs.comGraphics.com

    WebMediaBrands Corporate Info


    Advertise | Newsletters | Feedback | Submit News

    Legal Notices | Licensing | Permissions | Privacy Policy

    Powered by vBulletin® Version 3.7.3
    Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.