Button problem

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
If I place a button on either a Web form or an HTML form, when I run the
page in a browser, the button stretches right across the screen. This happens
with our Enterprise Visual Studio at work & the Web developer Express edition
I have at home.

Has anybody experienced this problem?

Many thanks for any ideas on how to fix it.

Ant
 
It doesn't happen for me. Sounds like you have some sort of formatting
issues. Unfortunately, you didn't provide your code so I have nothing to go
on.
 
Thanks for the interest,

The code is quite simple. Here is the Markup:

<body>
<form id="form1" runat="server">

<asp:Button ID="Button1" runat="server" Style="z-index: 100; left:
207px; position: absolute;
top: 171px" Text="Button" />
</form>
</body>



simply dropped a button onto the form. I also tried removing the default
divs to see if that would fix it but it didn't help.

It's strange that it happens on two separate systems running two different
version of ASP, yet nobody else has seen this issue.(?)

Anyway, hope this might help

Many thanks

Ant
 
And there's no other CSS styles involved?

I'm not sure what you are seeing but I'd start by removing each element of
the style attribute. Looks like you're using absolute positioning. I don't
think too many people are using that mode I strongly suspect that is related
to what you are seeing.
 
Hi Jonathon,

Absolutely not. No CSS. Apart from "position", left & top there isn't any
css in the project, no css in the head & the markup I pasted is all there is
apart from the simple div tags I took off. Strange eh!

I discovered something though:

When the style position attribute is set to Absolute in conjunction with top
& left attribute as px, it stretches. When I change top & left to % or use
static or relative, it had no issue.

Do you find you have the issue if you use Absolute with px?

Thanks very much for your feedback on this. I'd like to determine if this is
a bug or my setup

Thanks

Ant





This is what I do:

I create a new project,
switch to design mode,
drag a button onto the default page,
run the application
View a button stretched right across my screen.
Tried it with an HTML button to the same effect
 
Ant,
Do you find you have the issue if you use Absolute with px?

No, because, as indicated, I never use absolute positioning. <g>

I can try it sometime if I get a chance.
Thanks very much for your feedback on this. I'd like to determine if this
is
a bug or my setup

The way to determine which is to load it in your browser. The browser is
where it needs to work.
 
Hi Jonathan,

You are quite right. It is related to Absolute positioning. Now that I know
what it is I can work around it at least. Many thanks!

I'm surprised that not many people use Absolute. I come from a Windows Form
background & to me, Absolute is very wysiwyg, especially in conjuction with
using the layout functionality. It uses divs & works well. I wonder why
Absolute is not used much(?). But I guess that's a question for another
thread ;)

Many thanks Jonathan for helping work this out.

Cheers
Ant
 
FWIW, I come from a Windows form background also (at least, when I was using
VB).

But I just don't find absolute positioning natural, appropriate, or
efficient when we're talking Web pages.
 
Back
Top