Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Relative Positioning & Fixed Sizing in ASCX Controls

Reply
Thread Tools

Relative Positioning & Fixed Sizing in ASCX Controls

 
 
Alex Maghen
Guest
Posts: n/a
 
      05-06-2006
I'm trying to make a tiny login-block control that I'll use here and there. I
had tried creating the ASCX and making the outer-most object an <aspanel>
object with a style that contains position: relative. Then, I placed all the
little text boxes, etc inside that panel with absolute positioning.

I also used properties such as height and width of the text boxes and font
sizes, etc. to make everything fit just right.

In the VS environment, everything looks great, but when I load the thing in
the browser, the text boxes aren't the same small size that they had been,
they overlap with each other a little, and the Button control isn't the same
size either.

I thought that this might be because a style-sheet overrode the specific
settings on the control but, first of all, I thought that the specific
settings on the control are supposed to override the CSS. Also, my CSS
doesn't have any settings in it for INPUT or BUTTON.

Any idea what's going on here?

Alex
 
Reply With Quote
 
 
 
 
gerry
Guest
Posts: n/a
 
      05-06-2006
relative positioning is relative to the position that the item would have
had with normal flow.
absolute positioning is absolute relative to the top left corner of the web
page NOT the top left corner of the parent object

i'm not sure what use relative positioning is on the outer container
absolute positioning on the contained objects will almost certainly move
them outside of their container.

html inline styles override css styles, both override html attributes

are you sure that your .css is having any effect at all ?

can you post the html or a linkg to the page ?

Gerry



"Alex Maghen" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I'm trying to make a tiny login-block control that I'll use here and

there. I
> had tried creating the ASCX and making the outer-most object an

<aspanel>
> object with a style that contains position: relative. Then, I placed all

the
> little text boxes, etc inside that panel with absolute positioning.
>
> I also used properties such as height and width of the text boxes and font
> sizes, etc. to make everything fit just right.
>
> In the VS environment, everything looks great, but when I load the thing

in
> the browser, the text boxes aren't the same small size that they had been,
> they overlap with each other a little, and the Button control isn't the

same
> size either.
>
> I thought that this might be because a style-sheet overrode the specific
> settings on the control but, first of all, I thought that the specific
> settings on the control are supposed to override the CSS. Also, my CSS
> doesn't have any settings in it for INPUT or BUTTON.
>
> Any idea what's going on here?
>
> Alex



 
Reply With Quote
 
 
 
 
Steven Cheng[MSFT]
Guest
Posts: n/a
 
      05-08-2006
Thanks for Gerry's input.

Hi Alex,

Yes, as Gerry has mentioned, the relative or absolute position mode on web
page are all based on the whole page's scope(espeically for absolute mode).
When we use absolute position for html elements (or asp.net server
controls), no matter they are put in page's top level or nested in other
container controls, their final calculated position is aligned with the
while page's start point rather than its parent container. Also, for web
page, I always suggest use relative position(flow layout), it can make the
page display flexible when user sizing the browser window.

BTW, as for VS IDE's design-view for web page does differents some from its
runtime displayed version. This is because the designer need to make the
design-view convenient for user to edit/modify it. For example, when we
nest one html table in another, if we set the same width and heigh for
them, the IDE will still display some padding space between them so that we
can select each of them to do some modification.

Regards,

Steven Cheng
Microsoft Online Community Support


==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================


This posting is provided "AS IS" with no warranties, and confers no rights.

 
Reply With Quote
 
Steven Cheng[MSFT]
Guest
Posts: n/a
 
      05-10-2006
Hey Alex,

Any further progress on this issue? If there is still anything we can help,
please feel free to post here.

Regards,

Steven Cheng
Microsoft Online Community Support


==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================


This posting is provided "AS IS" with no warranties, and confers no rights.



Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Mouse position in both fixed and relative positioning Nikolai Prokoschenko Javascript 2 05-18-2011 11:25 AM
relative sizing does not nest? PJ6 ASP .Net 0 08-15-2005 12:01 AM
CSS positioning : relative, fixed, absolute and liquid layouts KatB HTML 8 02-14-2005 11:37 PM
Sizing and positioning of dynamic controls Tim Marsden ASP .Net 4 03-02-2004 05:42 AM
[ASCX] Add an ascx in a webcontrol... Quentin ASP .Net 1 07-29-2003 07:37 PM



Advertisments