Jump to content

Center top horizontal menu


Pelleque

Recommended Posts

Hello, first of all, sorry for my bad English, I have a small mismatch that I do not know how I can change it, I can not find the part of the code where to do it.

I would like the categories to be aligned vertically, that is, in the center. I would also like to reduce that white stripe a bit.

Thank you, I wait your answer.

 

image.thumb.png.eac2cd1a6e2acd0cf68539cabbf19dff.png

Link to comment
Share on other sites

Could you post the site address? Can't give you very precise info without seeing the code. If the div containing the navigation bar is streched vertically as much as the logo, you should be able to vertically center it with CSS vertical-align: middle

Link to comment
Share on other sites

1 minute ago, direwald said:

Could you post the site address? Can't give you very precise info without seeing the code. If the div containing the navigation bar is streched vertically as much as the logo, you should be able to vertically center it with CSS vertical-align: middle

There is: http://s773038918.mialojamiento.es/

I was searching the exact element to vertical align, but I can't find it.

Link to comment
Share on other sites

 

If you give your "row" class that includes your header elements the attributes

display: flex;
align-items: center;

It's gonna vertically center all the elements within. I'd then play with the margins on the rest of those elements to make them properly centered, though there might be a better way of doing that.

 

Link to comment
Share on other sites

On 3/9/2019 at 11:18 AM, direwald said:

 

If you give your "row" class that includes your header elements the attributes


display: flex;
align-items: center;

It's gonna vertically center all the elements within. I'd then play with the margins on the rest of those elements to make them properly centered, though there might be a better way of doing that.

 

Nono, I have this:

image.thumb.png.707ca82c65de18383e829ffd4bc0d4df.png

 

And I want this (paint edited):

 

image.thumb.png.a7a4062c1bc585933efc0cd6b4e71304.png

Link to comment
Share on other sites

If you do the changes I wrote, it will do what you ask for, or it'll at least get you closer. It will make the menu and the search bar divs vertically centered within the row. You can then work with those divs themselves to get them where you want to.

Link to comment
Share on other sites

  • 6 months later...
On 3/11/2019 at 7:26 PM, direwald said:

If you do the changes I wrote, it will do what you ask for, or it'll at least get you closer. It will make the menu and the search bar divs vertically centered within the row. You can then work with those divs themselves to get them where you want to.

right. I suppose I missed the part "vertically centered" in topic name ;-(  I'm looking for horizontally centered , and non of the solution I've found so far doesn't work ;-(

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...