html - how to center inline elements -
what trying center title in middle of page. inline search bar , centering based off of distance edge of search bar other side. how can make ignores search bar is? https://jsfiddle.net/nyvxhb4h/, in jsfiddle nav menu centered, title should right above it. -kyle
here problem area think incase jsfiddle link stops working:
#head { margin: 2% auto 2% auto; text-align: center; } #head h1 { display: inline; } <div id="head"> <h1> title </h1> <form action="test.asp" style="float:right; margin-right: 3%;"> <input type="text"> </form> </div>
move form
before h1
, update css position:absolute; right:0
. https://jsfiddle.net/nyvxhb4h/1/
<div id="head"> <form action="test.asp" style="position:absolute; right:0; margin-right: 3%;"> <input type="text"> </form> <h1> title </h1> </div>
Comments
Post a Comment