0

The position of my "Download" button in the following code depends on the size of the text to the left of it. If the text is long the button gets pushed to the right and if the text is small the button is too far to the left.

<td><p><strong>jk</strong></p><div><p>jk</p></div><span class="rating stars-4"></span></td>
<td><p><strong>Version:2.0</strong></p><a class="button-flat" href = "http://randomdomfile.com/random.txt>Download</a></td>

I have also attached a picture to show what I mean. enter image description here

Basically, the position of the Version and Download is depending on the size of the title or "jk". I want the button and version to be pushed to the right edge of the screen at all times. How would I do this?

UPDATE: Here's the new code I am using according to what you said:

<td><p><strong>jk</strong></p><div><p>jk</p></div><span class="rating stars-4"></span></td>
<td><div class = "newformat"><p><strong>Version:2.0</strong></p><a class="button-flat" href = "http://randomdomfile.com/random.txt>Download</a></div></td>

.newformat{
     position:absolute; 
     right:0;
}



a.button-flat {
display: block;
line-height: 40px;
height: 40px;
width: 100px;
background: #F6F6F6 url(../images/sprite-button-flat.png) repeat-x 0px 0px;
text-align: center;
border-bottom: 2px solid #D8D8D8;
border-left: 1px solid #D8D8D8;
border-right: 1px solid #D8D8D8;
border-top: 1px solid #D8D8D8;
text-decoration: none;
color: #333333;
padding: 0 .3em;
margin-bottom: 0.5em;
}
4

1 回答 1

2

在按钮的 CSS 上使用position:absoluteright:0 。

于 2013-06-26T13:29:51.977 回答