Sök i support

Akta dig för supportbedrägerier: Vi kommer aldrig att be dig att ringa eller skicka ett sms till ett telefonnummer eller dela personlig information. Rapportera misstänkt aktivitet med alternativet "Rapportera missbruk".

Learn More

Rendering bug with absolutely positioned button tags

  • 1 svar
  • 1 har detta problem
  • 6 visningar
  • Senaste svar av cor-el

more options

I'm using Firefox 10.0.1 and I've found a bug regarding button elements that are absolutely positioned. The problem is setting both the right and left CSS attributes does not affect the width of the button as it should.

Here is some example code to show what I mean (the forum is mangling the html, hopefully you can get the gist of it):

<html>
	<body>
		<div style="width: 500px; position: relative;">
			<button style="position: absolute; left: 0; right: 0;">Test</button>
		</div>
	</body>
</html>

In all other browsers the button will be 500px wide. In Firefox, it will fit to the text.

I'm using Firefox 10.0.1 and I've found a bug regarding button elements that are absolutely positioned. The problem is setting both the right and left CSS attributes does not affect the width of the button as it should. Here is some example code to show what I mean (the forum is mangling the html, hopefully you can get the gist of it):<br /> <br /> <pre><nowiki><html> <body> <div style="width: 500px; position: relative;"> <button style="position: absolute; left: 0; right: 0;">Test</button> </div> </body> </html></nowiki></pre> In all other browsers the button will be 500px wide. In Firefox, it will fit to the text.

Ändrad av cor-el

Alla svar (1)

more options

Why don't you give that button a width:100% if you want it to take the full width of that DIV container?