Jump to content

logo position


Nic727

Recommended Posts

Hi,

 

I have a problem with my logo position :

 

1418065480-logo.png

 

I want it more on the top to be centered with my name.

I tried margin-bottom and padding-bottom, but it doesn't work.

 

Thank you for your help

 

 

 

My code :

 <div class="logo"><img src="img/logo2.png" width="30px" alt="logo" /></div>  <span class="light">Name</span> Last Name
.logo{float: left;margin-right: 10px;cursor: pointer;}
Edited by Nic727
Link to comment
Share on other sites

Because it's floated you can't move it relative to the line of text.

 

Try having the image inside the same element as the text is. You can even remove the float: left part, it won't be necessary.

<img id="logo" src="img/logo2.png" width="30px" alt="logo" /> <span class="light">Name</span> Last Name#logo {    vertical-align: middle;}

Vertical-align can take numeric values as well, if you want to be specific with the vertical positioning of the image relative to the text that's next to it.

Link to comment
Share on other sites

Because it's floated you can't move it relative to the line of text. Try having the image inside the same element as the text is. You can even remove the float: left part, it won't be necessary.

<img id="logo" src="img/logo2.png" width="30px" alt="logo" /> <span class="light">Name</span> Last Name#logo {    vertical-align: middle;}
Vertical-align can take numeric values as well, if you want to be specific with the vertical positioning of the image relative to the text that's next to it.

 

Thank you, I just put a <div> to regroup the logo and the text and it worked with your code.Thank you
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...