As most of us probably know, the <centertag is deprecated. Because many
elements and controls have an align attribute, centering them is easy
enough. However, certain elements/controls do not (such as the ASP.NET
Button and Label controls). For the ASP.NET label control I usually just add
the following attributes:
Width="100%" style="text-align:center;"
However, this does not work for controls such as the ASP.NET Button control.
The only solution I can think of is to nest it inside of <div
align="center"></divtags. However, this could add a lot of extra tags. Any
suggestions? Thanks.
--
Nathan Sokalski nj********@hotmail.com http://www.nathansokalski.com/ 5 2420
<div align='center'>
</div>
--
Happy Hacking,
Gaurav Vaish | www.mastergaurav.com www.edujini-labs.com http://eduzine.edujinionline.com
-----------------------------------------
"Nathan Sokalski" <nj********@hotmail.comwrote in message
news:%2****************@TK2MSFTNGP06.phx.gbl...
As most of us probably know, the <centertag is deprecated. Because many
elements and controls have an align attribute, centering them is easy
enough. However, certain elements/controls do not (such as the ASP.NET
Button and Label controls). For the ASP.NET label control I usually just
add the following attributes:
Width="100%" style="text-align:center;"
However, this does not work for controls such as the ASP.NET Button
control. The only solution I can think of is to nest it inside of <div
align="center"></divtags. However, this could add a lot of extra tags.
Any suggestions? Thanks.
--
Nathan Sokalski nj********@hotmail.com http://www.nathansokalski.com/
As I said in my original message, I have used that, but would like to have a
way that does not involve any extra tags (in other words, I would like to do
it using CSS). Any other ideas? Thanks.
--
Nathan Sokalski nj********@hotmail.com http://www.nathansokalski.com/
"Gaurav Vaish (MasterGaurav)" <ga*****************@nospam.gmail.comwrote
in message news:%2****************@TK2MSFTNGP02.phx.gbl...
<div align='center'>
</div>
--
Happy Hacking,
Gaurav Vaish | www.mastergaurav.com www.edujini-labs.com http://eduzine.edujinionline.com
-----------------------------------------
"Nathan Sokalski" <nj********@hotmail.comwrote in message
news:%2****************@TK2MSFTNGP06.phx.gbl...
>As most of us probably know, the <centertag is deprecated. Because many elements and controls have an align attribute, centering them is easy enough. However, certain elements/controls do not (such as the ASP.NET Button and Label controls). For the ASP.NET label control I usually just add the following attributes:
Width="100%" style="text-align:center;"
However, this does not work for controls such as the ASP.NET Button control. The only solution I can think of is to nest it inside of <div align="center"></divtags. However, this could add a lot of extra tags. Any suggestions? Thanks. -- Nathan Sokalski nj********@hotmail.com http://www.nathansokalski.com/
Do you mean aligning the text inside a button? Aligning with
style="text-align:xxx" does work for this.And the text is already centered
by default. Do you mean something else?
--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET] http://msmvps.com/blogs/egoldin http://usableasp.net
"Nathan Sokalski" <nj********@hotmail.comwrote in message
news:%2****************@TK2MSFTNGP06.phx.gbl...
As most of us probably know, the <centertag is deprecated. Because many
elements and controls have an align attribute, centering them is easy
enough. However, certain elements/controls do not (such as the ASP.NET
Button and Label controls). For the ASP.NET label control I usually just
add the following attributes:
Width="100%" style="text-align:center;"
However, this does not work for controls such as the ASP.NET Button
control. The only solution I can think of is to nest it inside of <div
align="center"></divtags. However, this could add a lot of extra tags.
Any suggestions? Thanks.
--
Nathan Sokalski nj********@hotmail.com http://www.nathansokalski.com/
No, I am referring to horizontally centering the button on the page (or
within the div, td, or other tag that it is contained in). Thanks.
--
Nathan Sokalski nj********@hotmail.com http://www.nathansokalski.com/
"Eliyahu Goldin" <RE**************************@mMvVpPsS.orgwrote in
message news:OP**************@TK2MSFTNGP04.phx.gbl...
Do you mean aligning the text inside a button? Aligning with
style="text-align:xxx" does work for this.And the text is already centered
by default. Do you mean something else?
--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET] http://msmvps.com/blogs/egoldin http://usableasp.net
"Nathan Sokalski" <nj********@hotmail.comwrote in message
news:%2****************@TK2MSFTNGP06.phx.gbl...
>As most of us probably know, the <centertag is deprecated. Because many elements and controls have an align attribute, centering them is easy enough. However, certain elements/controls do not (such as the ASP.NET Button and Label controls). For the ASP.NET label control I usually just add the following attributes:
Width="100%" style="text-align:center;"
However, this does not work for controls such as the ASP.NET Button control. The only solution I can think of is to nest it inside of <div align="center"></divtags. However, this could add a lot of extra tags. Any suggestions? Thanks. -- Nathan Sokalski nj********@hotmail.com http://www.nathansokalski.com/
Nathan Sokalski napisał(a):
No, I am referring to horizontally centering the button on the page (or
within the div, td, or other tag that it is contained in). Thanks.
According to css specifications text-align:center should only center
text content of element. What you want achieve, is done with margin: auto;
IE of course doesn't support it:(
other browsers (opers, firefox, safari) supports it.
In IE you should apply text-align:center to parent element of your
button, because IE applies centering to all content (not only text).
If you don't want to center all content - apply text-align:left to
content which you don't want to center.
--
PP This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: The Plankmeister |
last post by:
Hi...
What's an equivalent of doing:
<center>hello!</center>
in 4.01 strict? I'm using stylesheets and am telling the various selectors I
want to be centred to "text-align : center;" but...
|
by: Mark Moore |
last post by:
It looks like there's a pretty serious CSS bug in IE6
(v6.0.2800.1106). The HTML below is validated STRICT HTML 4.01 and
renders as I would expect in Opera, FrontPage, and Netscape.
For some...
|
by: Dan |
last post by:
Hi,
I would just like to know if the istream operator takes only one
parammeter(object) at a time (like z) ?
istream operator>>(istream& in, Shape &z)
Cause I keep getting error concerning the...
|
by: Julia Briggs |
last post by:
How do I construct a <iframe> or equivalent for FireFox/NS browsers,
inside a screen centered <div> tag? Can it be done?
|
by: Steve Richter |
last post by:
I am using <div align=centerto center a horizontal menu on the page.
Problem is the center align of the div is rippling down to the menu
items and causing the text of the dynamic popup sub menu...
| |
by: jobs |
last post by:
I have a simple login page with roughly a 300px x 300px image behind
the asp.net login control. I need the login control to land in the
middle of the image. I want both the image and the login...
|
by: DiamondEagle |
last post by:
Is there a way to center the following div without using the <center>
tags?
<body bgcolor="#FFFFFF">
<center>
<div id="Test" style="background-color:#000000; color:#ffffff; width:
80%;...
|
by: Stevo |
last post by:
I've found that for IE6+, if you add the property text-align:center to a
DIV, then *anything* inside it gets centered. That can be a table, an
object/embed, another DIV, an image, or some text.
...
|
by: Plater |
last post by:
To accomplish what I am looking for (the image centered in it's parent top 'centered') I have done this:
<div id="backing">
<div id="lbImgBacker">
<center>
<img id="Image1"...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
| |