First we need to sort your html.
Then look at your css your <a> if you are using propiska, etc. you need to make a block level element.
remove the 50px height from your navigator that you do not want to give height. Instead, use the indentation <a> to get the desired height, which helps with responsiveness.
But since we want it to sit next to your image, use inline-block
also do not use CSS to determine the height and width of the tag, you must use the attributes of the tags to render smoothly.
Also you need to use alt on the images.
Your image will also need the following css rules:
img#gnb_logo { vertical-align:middle; margin:0 10px; }
So that he sits the way you want, next to his link.
Also, if this is your site logo, it should not be inside <nav>
If it's an icon relative to the link, use background-image instead of using <img>
body { background-color: #C8F1BA; margin: 0px; } ul, li { list-style: none; } div#gnb_bg { margin: 0px; padding-top: 0px; padding-bottom: 0px; border-right: 10px solid black; } a.gnb { background-color: #99FF33; text-decoration: none; font-size: 26px; border-right: 1px solid #448811; padding-right: 2.5%; padding-left: 2.5%; padding-top: 14px; padding-bottom: 14px; margin: 0px; display: inline-block; } img#gnb_logo { vertical-align:middle; margin:0 10px; } nav#gnb { text-align: center; background-color: #99FF33; }
<header> <nav id="gnb" role="navigation" aria-label="Global Navigation"> <ul id="gnb_bg"> <li> <a class="gnb" href="../feedbacks/feedbacks.html">feedbacks</a> <img id="gnb_logo" src="../images/logo.gif" height="30" alt="GNB Logo" /> </li> </ul> </nav> </header>
Dcdaz
source share