Click here to Skip to main content
15,884,353 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
here i want to display image in center then right to that image i want to display Company 1 | Welcome admin |Logout

here my problem is am getting this thing Company 1 | Welcome admin |Logout in next line
can u tell me y this is hapening .
HTML
<header>
    <div style="top: 0px; padding: 5px; background-color: black;">
        <div style="text-align:center;margin-left:auto;margin-right:auto;width:40%">
            <img src="~/Content/Images/JPL_Logo.PNG"  />
        </div>
         <div style="color:#FFFF33;height:30px;float:right;">
             Company 1 | Welcome admin | <a href="~/Login/Create" style="color:yellow !important;">Logout</a>
         </div>
        <div class="cleardiv"></div>
    </div>
    <div style="padding: 0px; background-color: black;">
         @Html.Partial("~/Views/Shared/Navigation.cshtml")
    </div>
</header>
Posted
Updated 16-Jan-14 22:22pm
v2

1 solution

Try this

HTML
<header>
     <div style="top: 0px; padding: 5px; background-color: black;">
         <div style="text-align:center;margin-left:auto;margin-right:auto;">
         <div style="float:left; width:80%">
             <img src="Content/Images/JPL_Logo.PNG"  height="100px" width="100px" />
         </div>
             <div style="color:#FFFF33;height:30px;float:right;">
              Company 1 | Welcome admin | <a href="~/Login/Create" style="color:yellow !important;">Logout</a>
          </div>
         </div>
         <div class="cleardiv"></div>
     </div>

 </header>
 
Share this answer
 
Comments
karthik mushyam 17-Jan-14 4:49am    
here am not getting image in center
Sandeep Singh Shekhawat 17-Jan-14 4:54am    
you can add center tag over <img> tag.
karthik mushyam 17-Jan-14 4:57am    
if i increase the width to 90% to get image center ..left side text coming down
Sandeep Singh Shekhawat 17-Jan-14 5:12am    
you need to define padding or margin of image tag. Don't increase width of div.
karthik mushyam 17-Jan-14 5:20am    
thanks i got it ..through padiing

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900