Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Why does float:right cause a line break? 1

Status
Not open for further replies.

leegold2

Technical User
Oct 10, 2004
116
Why does float:right cause a line break? Try the code below. Is there a fix? I want the link on the same line as the text. Thanks


<html>
<head>
<STYLE>
span.linkpos { float:right; clear: none; color:blue; }
</style>
</head>

<table border 1px >
<tr>
<td>
Source for configuration management documents and drawings from many projects. These are primarily engineering design documents. Each Directorate must be searched separately...
<span class=linkpos>
<a href=details. php?id=3&Type_view= detail&Type_Submit=&key_word= >see details</a>
</span>
</td>
</tr>
</table>
<html>
 

I'm surprised the page displays anything at all:

You have no open or close body tag, you have an open html tag instead of a close html tag, and you have not specified a type for your style tag. Other minor issues include the fact that you have spaces in your URL, and you have used virtually no quotes.

The real crux is that you need to move your span to befor the text for this to work. This looks good for me in FF and IE:

Code:
<html>
<head>
	<style type="text/css">
		span.linkpos {
			float:right;
			clear: none;
			color: blue;
		}
	</style>
</head>

<body>
	<table border 1px >
		<tr>
			<td>
				<span class="linkpos"><a href="details.php?id=3&Type_view=detail&Type_Submit=&key_word=">see details</a></span>
				Source for configuration management documents and drawings from many projects. These are primarily engineering design documents. Each Directorate must be searched separately...
			</td>
		</tr>
	</table>
</body>
</html>

Hope this helps,
Dan


The answers you get are only as good as the information you give!

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top