GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   The center element is deprecated (https://gfy.com/showthread.php?t=909182)

kenny 06-05-2009 10:51 PM

The center element is deprecated
 
The <center> tag is supported in all major browsers. However, it is deprecated and should be avoided!


http://www.w3schools.com/TAGS/tag_center.asp


Is there a good reason for this? Why is it suppose to be better to replace <center> with this mess"

#centered{
width: 800px; /* set to desired width in px or percent */
text-align: left; /* optionally you could use "justified" */
border: 0px; /* Changing this value will add lines around the centered area */
padding: 0;
margin: 0 auto;
}

PornMD 06-05-2009 10:55 PM

Quote:

Originally Posted by kenny (Post 15930279)
The <center> tag is supported in all major browsers. However, it is deprecated and should be avoided!


http://www.w3schools.com/TAGS/tag_center.asp


Is there a good reason for this? Why is it suppose to be better to replace <center> with this mess"

#centered{
width: 800px; /* set to desired width in px or percent */
text-align: left; /* optionally you could use "justified" */
border: 0px; /* Changing this value will add lines around the centered area */
padding: 0;
margin: 0 auto;
}

Yea, I have to admit it seems pretty lame. I have been using divs to do it and it seems to satisfy XHTML, but still I know I'm not doing it fully right.

rowan 06-06-2009 05:35 AM

<center> is probably my favourite tag, right after <td> :D I'm going to hell.

sysk 06-06-2009 06:43 AM

http://www.picpop.com/gallery/albums...1/timeline.gif

420 06-06-2009 06:46 AM

i wish i was cool <br><br><br><br><br><br> :(

MetaMan 06-06-2009 06:53 AM

Everything on a page should be controlled by a parent element, why would you center the element outside of the stylesheet when you are already giving it properties?

you are defeating the point of the CSS then.

seeandsee 06-06-2009 07:11 AM

CSS eats my shit :)

kenny 06-06-2009 07:13 AM

Quote:

Originally Posted by MetaMan (Post 15931010)
Everything on a page should be controlled by a parent element, why would you center the element outside of the stylesheet when you are already giving it properties?

you are defeating the point of the CSS then.


In this case it appears CSS is defeating it's self.

If I want to center the entire webpage I fail to see how any tool can be more effective than the <CENTER> tag.

CSS is soppose to make the job easier not harder

kenny 06-06-2009 07:18 AM

Quote:

Originally Posted by sysk (Post 15930987)


So its not breaking news.. I must of missed that months issue of Geek Magazine

Fuck off with that dumb time line shit

Did somebody beat me to this topic? Can you point out a duplicate thread?

TheDoc 06-06-2009 07:23 AM

This is what I use... it's compliant, and it works without question.
Code:

<div align="center">wrap/words</div>
Works great when everything else is left but you need a block of text centered.
Code:

<p align="center">words</p>

fris 06-06-2009 07:27 AM

http://buildinternet.com/2008/11/how...site-with-css/

kenny 06-06-2009 07:31 AM

Quote:

Originally Posted by fris (Post 15931102)

Yes, I know there are ways to do this using CSS

my point is that <center> did all of this without a block of code

kenny 06-06-2009 07:34 AM

Quote:

Originally Posted by TheDoc (Post 15931095)
This is what I use... it's compliant, and it works without question.
Code:

<div align="center">wrap/words</div>
Works great when everything else is left but you need a block of text centered.
Code:

<p align="center">words</p>

you're not suppose to do that now either

don't quote me but I'm pretty sure

kenny 06-06-2009 07:39 AM

Quote:

Originally Posted by TheDoc (Post 15931095)
This is what I use... it's compliant, and it works without question.
Code:

<div align="center">wrap/words</div>
Works great when everything else is left but you need a block of text centered.
Code:

<p align="center">words</p>

http://www.w3schools.com/tags/att_div_align.asp

Compatibility Notes

The align attribute of the div element was deprecated in HTML 4.01 and is not supported in XHTML 1.0 Strict DTD.

Use CSS instead.

CSS syntax: <div style="text-align:center">


None if it centers the whole webpage anyway..

TheDoc 06-06-2009 07:51 AM

Quote:

Originally Posted by kenny (Post 15931209)
http://www.w3schools.com/tags/att_div_align.asp

Compatibility Notes

The align attribute of the div element was deprecated in HTML 4.01 and is not supported in XHTML 1.0 Strict DTD.

Use CSS instead.

CSS syntax: <div style="text-align:center">


None if it centers the whole webpage anyway..



My example returns complaint... The div align=center centers a div, which centers the entire webpage. Using less html and css than any other method, that returns complaint.

It not returning complaint in xhtml strict, which I don't have anything that uses that, so I'm not really worried about it.

My example does use less bytes of data, it works in every browser - every time, and it returns complaint for me, every single time.

kenny 06-06-2009 07:58 AM

Quote:

Originally Posted by TheDoc (Post 15931315)
My example returns complaint... The div align=center centers a div, which centers the entire webpage. Using less html and css than any other method, that returns complaint.

It not returning complaint in xhtml strict, which I don't have anything that uses that, so I'm not really worried about it.

My example does use less bytes of data, it works in every browser - every time, and it returns complaint for me, every single time.

I was just shooting for 100% compliance across the board.

Your way is simpler than other CSS methonds.. but come on.. <CENTER> hands down walks this dog :1orglaugh

TheDoc 06-06-2009 08:05 AM

Quote:

Originally Posted by kenny (Post 15931357)
I was just shooting for 100% compliance across the board.

Your way is simpler than other CSS methonds.. but come on.. <CENTER> hands down walks this dog :1orglaugh

Object embeds aren't complaint either but it's better than using Javascript :)

donborno 06-06-2009 10:05 AM

The idea of XHTML and CSS is to keep structured content seperately from design and layout (for various reasons), not to reduce the number of letters you have to type.

Serge Litehead 06-06-2009 11:01 AM

whoa, last time i sow or used <center> was few good years back)

regarding tables, recently done one paysite tour, sliced in div 100% valid - we had to reslice it all in tables because client's cms had <tr>s and <td>s hardcoded into system - how crazy is that))))

iframe is no good too and default adobe's flash embed is not valid..

its hard to switch when you're used to old methods of doing things, but most of time after changing it becomes much better and easier and sometimes result in more options what you can do.

many do <div><div><div><div><div><div>.... find it crazy - call it transition from past century (tabled nesting), there is really no need to do such complex nesting to keep structure in tact. deep nesting is harder to maintain..

TheDoc 06-06-2009 11:19 AM

Quote:

Originally Posted by donborno (Post 15931983)
The idea of XHTML and CSS is to keep structured content seperately from design and layout (for various reasons), not to reduce the number of letters you have to type.

Creating ANYTHING is ALL about reducing the work and making it load/run faster. It doesn't make a difference if it's code, html or css..

It speeds up production, reduces possible errors and repeating text/code, makes the css more usable across multi-websites, it makes it work better across browsers, which all together reduces the amount of bytes used at several points, which helps make everything snap load faster, with the browser having to complete less work.

Having it this way doesn't mean you will make more sales... But when it's done this way across 100's of Websites, the group reduction makes a difference in my own costs. No different than reducing the sizes of my images or tiny gif's..

Hentaikid 06-06-2009 03:18 PM

It's been deprecated for ages, but most browsers still respect it out of backwards compatibility... so knock yourself out...


All times are GMT -7. The time now is 06:48 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123