I need to align 4 images which are acting as a link and these links are under a div tag. I am not quite sure how to align them perfectly because two in the left seem to be aligned but the ones in the right are causing the issue. Can I have some suggestions on how to fix this please. Currently this is how it looks like:I assumed all the components will be aligned properly since they are under a div tag with the same class name.如何對齊下<a href> tag?
CSS
.pagelinks {
float: right;
margin-right: 48%;
display: inline-block;
}
.pagelinks a {
text-decoration: none;
}
JSP/HTML代碼
<display:setProperty name="paging.banner.full" value='<div class="pagelinks"> <a href="{1}"> <img src="../images/integration/FastLeft.jpg"/> </a> <a href="{2}"> <img src="../images/integration/SlowLeft.jpg"/> </a> | Page {5} of {6} <a href="{3}"> | <img src="../images/integration/SlowRight.jpg"/> </a><a href="{4}"> <img src="../images/integration/FastRight.jpg"/> </a></div>'/>
<display:setProperty name="paging.banner.first" value='<div class="pagelinks"> <img src="../images/integration/FastLeft.jpg"/> <img src="../images/integration/SlowLeft.jpg"/> | Page {5} of {6} | <a href="{3}"> <img src="../images/integration/SlowRight.jpg"/> </a><a href="{4}"> <img src="../images/integration/FastRight.jpg"/></a></div>'/>
<display:setProperty name="paging.banner.last" value='<div class="pagelinks"> <a href="{1}"> <img src="../images/integration/FastLeft.jpg"/> </a> <a href="{2}"> <img src="../images/integration/SlowLeft.jpg"/> </a> | Page {5} of {6} | <img src="../images/integration/SlowRight.jpg"/> <img src="../images/integration/FastRight.jpg"/> </div>'/>
你的html在哪裏?請提供一個工作示例 – Dekel
糟糕,我完全忘了。我編輯我的問題。 – Mike
但是您沒有提供html/working demo – Dekel