473,770 Members | 1,902 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Attribute 'align' is considered outdated. A newer construct is recommended.

Hi,

I've been asked to "update" an existing fairly simple website to make it
XHTML-compliant i.e.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">
<html xmlns="http://www.w3.org/1999/xhtml" >
...
</html>

The site currently makes fairly heavy use of the following tag:

<div align="center">
...
</div>

This is great because, if the div contains text, it places that text in the
centre of the screen but does not apply any justification to the text
itself. However, as this syntax is deprecated in XHTML, I need to replace
it.

I found the following discussion:
http://www.codecomments.com/ASP_.NET/message713169.html which suggests using
the following tag instead:

<div style="text-align: center;">

However, that not only centres the div, it also centres the text inside it,
which is not what I want. Other sites suggest nesting tables within divs etc
which may or may not be cross-browser compatible.

What is everyone doing for this...?

Any assistance gratefully received.

Mark
Jul 11 '06 #1
2 15496
I prefer to use:
style="margin-left:auto; margin-right:auto;"

Alternatively wrap your div in another div with style="text-align:
center"

Mark Rae wrote:
Hi,

I've been asked to "update" an existing fairly simple website to make it
XHTML-compliant i.e.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">
<html xmlns="http://www.w3.org/1999/xhtml" >
...
</html>

The site currently makes fairly heavy use of the following tag:

<div align="center">
...
</div>

This is great because, if the div contains text, it places that text in the
centre of the screen but does not apply any justification to the text
itself. However, as this syntax is deprecated in XHTML, I need to replace
it.

I found the following discussion:
http://www.codecomments.com/ASP_.NET/message713169.html which suggests using
the following tag instead:

<div style="text-align: center;">

However, that not only centres the div, it also centres the text inside it,
which is not what I want. Other sites suggest nesting tables within divs etc
which may or may not be cross-browser compatible.

What is everyone doing for this...?

Any assistance gratefully received.

Mark
Jul 11 '06 #2
"Jacob" <ja***@reimers. dkwrote in message
news:11******** **************@ 75g2000cwc.goog legroups.com...
>I prefer to use:
style="margin-left:auto; margin-right:auto;"
OK.
Alternatively wrap your div in another div with style="text-align:
center"
Blimey!
Jul 11 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
7457
by: ALI-R | last post by:
How do I allign all my content in aspx page in the middle of page like a lot of websites ? Dose it work with differnet screen resolutions? Thanks for your help.
11
25392
by: Ben Amada | last post by:
Hello, When centering a block of HTML, in the past, I've always used: <div align="center"> ... </div> However, in VS 2005, I get the following warning: "Validation (XHTML 1.0 Transitional): Attribute 'align' is considered outdated. A newer construct is recommended."
6
16383
by: silverbob | last post by:
I am evaluating EWD, which seems to be an improvement over FrontPage. In code view, the program alerts you to items that are not HTML 4.0 compliant. For example, in this line... <td align="center" valign="middle" width="173" height="100" bgcolor="#ffffff" class="bdDkBluBld" colspan="3"> I am told that the following are "outdated and newer constructs are available": width
2
4568
by: Radu | last post by:
Hi. I have been working at home on a web project (VSNET 2005 SP1). Now I have brought the project at work, and I suddenly have plenty of warnings like: Validation (XHTML 1.0 Transitional) - Attribute..... is not a valid attribute of..... Validation (XHTML 1.0 Transitional) - Attribute..... is considered outdated. A newer construct is recommended. Validation (XHTML 1.0 Transitional) - Attribute values must be enclosed in quotation marks.
27
2839
by: pamela fluente | last post by:
Hello, for the following code, VS suggests that construct (width= height= ) is out of date and a newer one is recommended: <table><tr><td width="92" height="38" valign="middle">AnyThing</td></ tr></table> Would you please tell me the right construct (clearly must be functionally equivalent).
4
3878
by: Agos | last post by:
Microsoft Visual Studio when I use this tag <br clear="all" /> tells me: Warning 1 Validation (XHTML 1.0 Transitional): Attribute 'clear' is considered outdated. A newer construct is recommended. What should I use instead? Tank you
13
2674
by: Roderik | last post by:
Hi, I am wondering why (half of the) squared images are not aligned on the right of the text in Internet Explorer (using <img ... align="right" />. I thought this was supported even in IE. In FF and Opera it works fine. http://www.roderik.net/2008/05/25/robotchallenge-vienna-2008/ Mucht thanks for any suggestions.
5
4170
by: rote | last post by:
I have a webpart project i copied across and after setting up in VS 2005 all good. When i go to the design mode and try and autofornat my webpartzone to for example Simple or Professional. The i try and view it to Design mode i get error saying it can't be switched and then when i complile it i get these errors below !!! arg.. Attribute 'width' is considered outdated. A newer construct is recommended. Attribute 'Title' is not a valid...
0
9617
marktang
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10254
Oralloy
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10099
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10036
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8929
agi2029
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6710
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5354
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4007
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 we have to send another system
3
2849
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.