How to keep search box and web site logo at same level | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
+ 2

How to keep search box and web site logo at same level

logo is being shifted down when I add search box

2nd Apr 2017, 6:35 AM
sai Kumar
sai Kumar - avatar
9 Respuestas
+ 15
set top margin of your logo div or td
2nd Apr 2017, 6:37 AM
Krishna Kumar
Krishna Kumar - avatar
+ 14
@chirag:i suggest him table because its a basic concept and after little bit practice he will manage this things in div also
2nd Apr 2017, 7:32 AM
Krishna Kumar
Krishna Kumar - avatar
+ 13
make it in same row using different td
2nd Apr 2017, 6:39 AM
Krishna Kumar
Krishna Kumar - avatar
+ 13
@Krishna: Using the tables for layout is a legacy practice and it's not at all recommended for web design due to poor responsiveness
2nd Apr 2017, 7:00 AM
Chirag Bhansali
Chirag Bhansali - avatar
+ 11
This is because a block element(the search bar) starts from a new line. In such a situation, you should either enclose both the elements within any tag such as the <header> or the <div> tag and set the display property to flex(of the parent tag). The other solution for this is to set the display properties of the logo and search bar as inline-block. If you use this method you would not need to enclose them within any tag.
2nd Apr 2017, 6:42 AM
Chirag Bhansali
Chirag Bhansali - avatar
+ 5
What is flexbox?
28th Apr 2017, 4:09 PM
🔭 GP 🔭
🔭 GP 🔭 - avatar
+ 1
How to set
2nd Apr 2017, 6:37 AM
sai Kumar
sai Kumar - avatar
+ 1
i strongly suggest you to use flexbox if you are not Target IE < 11 and according to current data 93% of currently using webbrowser supports flexbox.
2nd Apr 2017, 6:52 AM
Keshave Jat
Keshave Jat - avatar
+ 1
It is easy! use position: absolute to the wrapper of search and use position: relative to your logo.
2nd Apr 2017, 12:05 PM
Waren Gonzaga
Waren Gonzaga - avatar