如何水平对齐代码

时间:2015-09-08 06:23:00

标签: html css

如何使这个水平对齐,我是新手,所以请不要给出苛刻的评论,我知道css用于对齐,但我不知道如何使用CSS,我不想要勺子喂,只是解释我,如何编辑此类代码的css

<html>
<body>

<div style="width:200px;height:900px;border:3px solid #000;"><div align="center"><a href=http://www.amazon.in/gp/goldbox/ref=as_li_ss_tl?ie=UTF8&camp=3626&creative=24822&linkCode=ur2&tag=droiddevsin-21">
<font size="3" color="Blue">Products to buy</font></a><hr><center>
<a href="http://www.amazon.in/gp/product/B00OK305S0/ref=as_li_tl?ie=UTF8&camp=3626&creative=24822&creativeASIN=B00OK305S0&linkCode=as2&tag=droiddevsin-21"><img border="0" src="http://ws-in.amazon-adsystem.com/widgets/q?_encoding=UTF8&ASIN=B00OK305S0&Format=_SL110_&ID=AsinImage&MarketPlace=IN&ServiceVersion=20070822&WS=1&tag=droiddevsin-21" ></a><img src="http://ir-in.amazon-adsystem.com/e/ir?t=droiddevsin-21&l=as2&o=31&a=B00OK305S0"><br>
<a href="http://www.amazon.in/gp/product/B00OK305S0/ref=as_li_tl?ie=UTF8&camp=3626&creative=24822&creativeASIN=B00OK305S0&linkCode=as2&tag=droiddevsin-21">OnePlus One (16GB)</a><img src="http://ir-in.amazon-adsystem.com/e/ir?t=droiddevsin-21&l=as2&o=31&a=B00OK305S0"><hr>
<a href="http://www.amazon.in/gp/product/B00GC1J55C/ref=as_li_tl?ie=UTF8&camp=3626&creative=24822&creativeASIN=B00GC1J55C&linkCode=as2&tag=droiddevsin-21"><img border="0" src="http://ws-in.amazon-adsystem.com/widgets/q?_encoding=UTF8&ASIN=B00GC1J55C&Format=_SL110_&ID=AsinImage&MarketPlace=IN&ServiceVersion=20070822&WS=1&tag=droiddevsin-21" ></a><img src="http://ir-in.amazon-adsystem.com/e/ir?t=droiddevsin-21&l=as2&o=31&a=B00GC1J55C"><br>
<a href="http://www.amazon.in/gp/product/B00GC1J55C/ref=as_li_tl?ie=UTF8&camp=3626&creative=24822&creativeASIN=B00GC1J55C&linkCode=as2&tag=droiddevsin-21">Google Nexus 5 D821 (16GB, Black)</a><img src="http://ir-in.amazon-adsystem.com/e/ir?t=droiddevsin-21&l=as2&o=31&a=B00GC1J55C"><hr>
<a href="http://www.amazon.in/gp/product/B00VEB0F22/ref=as_li_tl?ie=UTF8&camp=3626&creative=24822&creativeASIN=B00VEB0F22&linkCode=as2&tag=droiddevsin-21"><img border="0" src="http://ws-in.amazon-adsystem.com/widgets/q?_encoding=UTF8&ASIN=B00VEB0F22&Format=_SL110_&ID=AsinImage&MarketPlace=IN&ServiceVersion=20070822&WS=1&tag=droiddevsin-21" ></a><img src="http://ir-in.amazon-adsystem.com/e/ir?t=droiddevsin-21&l=as2&o=31&a=B00VEB0F22"><br>
<a href="http://www.amazon.in/gp/product/B00VEB0F22/ref=as_li_tl?ie=UTF8&camp=3626&creative=24822&creativeASIN=B00VEB0F22&linkCode=as2&tag=droiddevsin-21">Mi 4 (White, 16GB)</a><img src="http://ir-in.amazon-adsystem.com/e/ir?t=droiddevsin-21&l=as2&o=31&a=B00VEB0F22"><hr>
<a href="http://www.amazon.in/gp/product/B00E57TA50/ref=as_li_tl?ie=UTF8&camp=3626&creative=24822&creativeASIN=B00E57TA50&linkCode=as2&tag=droiddevsin-21"><img border="0" src="http://ws-in.amazon-adsystem.com/widgets/q?_encoding=UTF8&ASIN=B00E57TA50&Format=_SL110_&ID=AsinImage&MarketPlace=IN&ServiceVersion=20070822&WS=1&tag=droiddevsin-21" ></a><img src="http://ir-in.amazon-adsystem.com/e/ir?t=droiddevsin-21&l=as2&o=31&a=B00E57TA50"><br>
<a href="http://www.amazon.in/gp/product/B00E57TA50/ref=as_li_tl?ie=UTF8&camp=3626&creative=24822&creativeASIN=B00E57TA50&linkCode=as2&tag=droiddevsin-21">Sony Xperia Z Ultra (Black, 16GB)</a><img src="http://ir-in.amazon-adsystem.com/e/ir?t=droiddevsin-21&l=as2&o=31&a=B00E57TA50"><hr>
<a href="http://www.amazon.in/gp/product/B00M6UC6LI/ref=as_li_tl?ie=UTF8&camp=3626&creative=24822&creativeASIN=B00M6UC6LI&linkCode=as2&tag=droiddevsin-21"><img border="0" src="http://ws-in.amazon-adsystem.com/widgets/q?_encoding=UTF8&ASIN=B00M6UC6LI&Format=_SL110_&ID=AsinImage&MarketPlace=IN&ServiceVersion=20070822&WS=1&tag=droiddevsin-21" ></a><img src="http://ir-in.amazon-adsystem.com/e/ir?t=droiddevsin-21&l=as2&o=31&a=B00M6UC6LI" ><br>
<a href="http://www.amazon.in/gp/product/B00M6UC6LI/ref=as_li_tl?ie=UTF8&camp=3626&creative=24822&creativeASIN=B00M6UC6LI&linkCode=as2&tag=droiddevsin-21">Google Nexus 9 Tablet (WiFi, 16GB), Lunar White</a><img src="http://ir-in.amazon-adsystem.com/e/ir?t=droiddevsin-21&l=as2&o=31&a=B00M6UC6LI" >

</center></div></div>
</body>
</html>

3 个答案:

答案 0 :(得分:1)

您只需要使用CSS将第一个div元素的边距设置为0 auto,如下所示:

<div style="margin:0 auto;width:200px;height:900px;border:3px solid #000;">

答案 1 :(得分:0)

style="text-align:center;"添加到div标签(您需要在其中对齐中心)

删除<center>代码

答案 2 :(得分:0)

首先从filter_update(filtered_state_mean, filtered_state_covariance, observation=None, transition_matrix=None, transition_offset=None, transition_covariance=None, observation_matrix=None, observation_offset=None, observation_covariance=None)

中删除标记center

而不是添加

HTML