I have an HTML doc that looks roughly like this:
<html>
<head><title>Example</title></head>
<body>
<div id="main_content" style="width:90%;">
<form id="searchbox" method="post" action="#">
<input type="text" name="search" />
<开发者_StackOverflow社区;input type="submit />
</form>
</div>
</body>
</html>
How do I (horizontally) center the search form in the page?
Using CSS:
- assign it a
width
- use
margin-left:auto
,margin-right:auto
精彩评论