Logo and menu in same alignment in html

navigation bar center align css
how to center navigation bar css
responsive navigation with centered logo
html menu
how to create menu in html
scroll down menu html
how to increase menu bar size in html
drop down navigation menu html

I'm a beginner in HTML and CSS. I want to put a logo and and a menu in the same alignment. I put the logo and menu in same div and tried to float them on left and right respectively, but still the logo and the menu are in different alignments.

Here is my code: Fiddle

the HTML part:

<div class="set header">
    <div class name="set logo">
        <img src="image/r3v_logo2.png" alt=""/>
    </div>
    <div class="set mainmenu">
        <ul> 
            <li><a href="">Home</a> </li> 
            <li><a href="">Forum</a> </li>
            <li><a href="">Gallery</a> </li> 
            <li><a href="">About Us</a> </li> 
            <li><a href="">Facebook</a> </li>
            <li><a href="">Help & FAQ</a> </li> 
        </ul>
    </div>                      
</div>

Thanks.

from this:

<div class name="logo">

to this:

<div class="logo">

then on css, try to follow this code:

.logo {
float:right; (it depends on you if you want to place it on left or right)
}

.mainmenu {
float:right;
}

Here's your code that I'd try to test:

<div class="header">
    <div class="logo">
        <img src="image/r3v_logo2.png" alt=""/>
    </div>
    <div class="mainmenu">
        <ul> 
            <li><a href="">Home</a> </li> 
            <li><a href="">Forum</a> </li>
            <li><a href="">Gallery</a> </li> 
            <li><a href="">About Us</a> </li> 
            <li><a href="">Facebook</a> </li>
            <li><a href="">Help & FAQ</a> </li> 
        </ul>
    </div>                      
 </div>

or

 <div class="header">
    <div class="logo" style="float:right">
        <img src="image/r3v_logo2.png" alt=""/>
    </div>
    <div class="mainmenu" style="float:right">
        <ul> 
            <li><a href="">Home</a> </li> 
            <li><a href="">Forum</a> </li>
            <li><a href="">Gallery</a> </li> 
            <li><a href="">About Us</a> </li> 
            <li><a href="">Facebook</a> </li>
            <li><a href="">Help & FAQ</a> </li> 
        </ul>
    </div>                      
 </div>

How To Create Right Aligned Menu Links, Well organized and easy to understand Web building tutorials with lots of examples of how to use HTML, CSS, JavaScript, SQL, PHP, Python, Bootstrap, Java  How do I put my logo on the left within my navigation menu? I am trying to float my logo left and navigation to the right, but I want both logo and navigation should be on the same line. Logo left and nav right.

try this

<div class="set header">
    <div class name="set logo" style="float:left;">
        <img src="image/r3v_logo2.png" alt=""/>
     </div>

    <div class="set mainmenu" style="float:left;">
       <ul> 
           <li><a href="">Home</a> </li> 
           <li><a href="">Forum</a> </li>
           <li><a href="">Gallery</a> </li> 
           <li><a href="">About Us</a> </li> 
           <li><a href="">Facebook</a> </li>
           <li><a href="">Help & FAQ</a> </li> 
       </ul>
   </div>                      

How To Create Centered Menu Links, Learn how to create a navigation bar with a centered link/logo. Centered Menu Link. Home. News Contact </div> <!-- Left-aligned links (default) --> . logo {color: # 663399; font-size: 25 px; font-family: verdana; text-align: left; margin-top: 0 px; float: left; margin: 0 px; line-height: 50 px; padding-left: 9 px;} We had used line-height property. It defines amount of space above and below html elements. It is used to align two elements on a same line of height.

Please check this fiddle

Click here

       <div class="set main">
            <div class="set header">
                <div class name="set logo">
                    <img src="image/r3v_logo2.png" alt=""/>
                    <div class="set mainmenu">
                    <ul> 
                        <li><a href="">Home</a> </li> 
                        <li><a href="">Forum</a> </li>
                        <li><a href="">Gallery</a> </li> 
                        <li><a href="">About Us</a> </li> 
                        <li><a href="">Facebook</a> </li>
                        <li><a href="">Help & FAQ</a> </li> 
                    </ul>
                </div>  
                </div>

            </div>
</div>

Div is display block

so it will occupy whole row instead if you want to align two value in horizontal you can put them in a same div

Centering, aligning the menu and header logo, The examples below show how the menu and logo can be centered. This will involve editing each HTML page to remove those and center the header. Locate the following (or similar) code for the "logo.jpg" in the "header.js" and add: Responsive Design - I'm happy with how it is in the responsive design, I just need to sort out the logo. Thanks!

See updated fiddle http://jsfiddle.net/t8LDg/6/

The div that wraps the logo has to have display: inline-block and remove the float: right from the menu

    <div class="set main">
        <div class="set header">
            <div class name="set logo" style="display: inline-block;">
                <img src="http://3rxg9qea18zhtl6s2u8jammft.wpengine.netdna-cdn.com/wp-content/uploads/2013/10/lufthansa.jpg" width="200" alt=""/>
            </div>
            <div class="set mainmenu">
                <ul> 
                    <li><a href="">Home</a> </li> 
                    <li><a href="">Forum</a> </li>
                    <li><a href="">Gallery</a> </li> 
                    <li><a href="">About Us</a> </li> 
                    <li><a href="">Facebook</a> </li>
                    <li><a href="">Help & FAQ</a> </li> 
                </ul>
            </div>                      
        </div>

Vertically align text in responsive css menu (with a logo on right , I'm trying to vertically align to center text in responsive css menu with a logo I would suggest adding a line height equal to the height of your logo image to to  How to Align Something in HTML. Proper coding requires the use of CSS to align things in HTML, but not all websites let you customize the style-sheets so you can properly align the parts of your web page.

Now replace this

<div class name="set logo"> // not define your class

Into this

<div class="set logo"> // here define your class

Center logo in nav header, right align other logo, I've been asked to center the logo on our header and to put our HTML: <div> <​nav class="navbar"> <div> <button type="button" the same amount of space and then you can easily centre the main logo via normal means. @hauaua: There is no option to make the logo on the left and menu on the right in the header. It’s design to make the logo and right sidebar in the header and then menu. It’s design to make the logo and right sidebar in the header and then menu.

How to get nav bar and logo image on same line?, I suggest you to use display: flex; for the header tag as well this will help you align the logo and nav-list on the same line. And later you can  Tagged: header text, logo, menu This topic has 50 replies, 15 voices, and was last updated 3 years, 5 months ago by Sakin. Viewing 20 posts - 1 through 20 (of 51 total) 1 2 3 → Author Posts March 30, 2013 at 4:23 am #6167 igudgerParticipant I can’t figure out how to get my logo … Continue reading "Getting the logo in alignment with header text"

How can I align logo left and navbar right in site header , I'm trying to create a header with the logo and nav menu inside the same DIV tag, the logo to the far left and the nav menu to the far right. display: block; - Displaying the links as block elements makes the whole link area clickable (not just the text), and it allows us to specify the width (and padding, margin, height, etc. if you want) width: 60px; - Block elements take up the full width available by default. We want to specify a 60 pixels width.

How do I put my logo on the left within my navigation menu , I am trying to float my logo left and navigation to the right, but I want both logo and navigation should be on the same line. here</a> </div> <div class="main-nav"> <ul> <li><a href="index.html">Home</a></li> <li><a width:100%; } .main-nav ul li{ display:inline-block; text-align: center; margin-left:15px; }  How to place logo and nav in the same line with 100% width? HTML & CSS. godfather999. 2014-09-05 03:07:25 UTC #1. How to place logo and nav in the same line with 100% width?

Comments
  • <div class name="set logo"> remove name from here.
  • so kind of you, but it didn't work either.
  • add display: inline-block on the div with te class "logo" so it behaves like a inline block in the menu row
  • thanks man! you rock!!