简体   繁体   中英

Aligning two objects on left one right, on the same level

How do I Align two images so they are equal, but on different sides of the page?

Any Help?

<img src="image1.png" style="float:left">
<img src="image2.png" style="float:right">

you can use like this as well,

img{float:left;}
img+img{float:right;}

Here is the Demo.

example of your code

<div class="mainwrap">
<a id="left_img"><img src="1.jpg"></a>
<a id="right_img"><img src="2.jpg"></a>
</div>

ur css

.mainwrap
{
width:500px;
height:500px;
margin:auto;
}
#left_img
{
float:left;
}
#right_img
{
float:left;
}

try this

<div>
<a id="leftImg" style="float:left;"><img src="1.jpg"></a>
<a id="rightImg" style="float:right;"><img src="2.jpg"></a>
</div>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM