Anyone familiar with <center>? - html

I see this in a website for the first time of life.
Is it supported by all browsers?

It's deprecated as of HTML 4.01 and not supported in XHTML 1.0. Major browsers will support it though.

It's deprecated. Use CSS to center elements. It is supported in all major browsers though...

<center> is not part of the HTML 4.01 standard, so it's likely that some browsers wouldn't understand it.
The more correct way to center text uses the CSS text-align property.
If a browser doesn't understand a tag, it should ignore that tag. So, even if a browser doesn't understand <center>, it should not ruin the web page.

center tag puts the content in the middle of the line. It's kind of old-fashioned. CSS can do this well.

Related

<center> , <dir> tags have been expired in html5 but when i use them, work properly? [duplicate]

<!DOCTYPE html> specifies the page as html 5. But, when I used <center>, it can still center the content. Why <center> can still work in html 5 as I read from http://www.w3schools.com/tags/ that <center> is supposed to not work?
The tag is obsolete since HTML4. But it is still supported in some browsers even now. MDN advices to not use it
Obsolete
This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it.
Use css text-align: center instead.
It's not part of the specs anymore but it's up to the browser whether or not they still support the tag. Most browsers will to make sure older code still works.
But, since it is deprecated you should not use it in new code. Go with CSS to get your stuff centered.
Browsers may still support it and at some point they will not. Take at look at this page to see if you can use or should use an html element, css property and more: http://caniuse.com/#search=center
Since HTML4, <center>, and other presentation tags (such as <blink>) has been deprecated from HTML specs, and removed in HTML5 specs.
Those tags should be replaced by other content tags (the most abstract one being <div>) in addition to CSS for the styling they did provide.
But since those tags don't lead to any security issue, (contrary to <frame>) they may still be supported by browsers for compatibility issues.
Even if today, google's main page still uses it, you should prefer to use an other content tag with proper CSS styling.

HTML | What is <marquee> and what can i do with it?

I just found out that there is a html tag called <marquee>. I went to several websites including the w3schools and the selfHTML website but couldnt find anything about this tag. IntelliJ wich I'm using to write my websites, doesnot recognise this tag. It says: Unkown html tag marquee. This tag is how I tested compatible with all browsers(even in IE!).
So now I have the following Questions:
What atributes can I use for this tag?
Why isnt this tag on the html-turtorial sites?
If its not in the W3Schools -> who created this tag?
Just that you know what I'm all talking about:
<marquee>Test Marquee</marquee>
<p>Test Paragraph</p>
Thanks for answering
<marquee> is an old HTML element that causes whatever content inside of it to scroll across the viewport from right to left by default.
It may still work in some browsers for backwards compatibility, but it is no longer officially supported in HTML and should be avoided. That's why you are not finding it on tutorial sites. And since it is no longer supported, there is no guarantee that even if it works in some browsers today, it will continue to work in new versions of those browsers tomorrow.
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/marquee
The HTML <marquee> element is used to insert a scrolling area of text.
marquee tag is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Highly recommended not to use them with HTML5. Try to avoid using it.
Instead of marquee, you could use alternatives like jquery with css3 or CSS marquee style should be used instead. etc..
See https://developer.mozilla.org/en/docs/Web/HTML/Element/marquee..
The <marquee> tag is used to denote snippets of text or content that you want to scroll on a page.
Taken from MDN:
<marquee>This text will scroll from right to left</marquee>
<marquee direction="up">This text will scroll from bottom to top</marquee>
<marquee direction="down" width="250" height="200" behavior="alternate" style="border:solid">
<marquee behavior="alternate">
This text will bounce
</marquee>
</marquee>
However, you don't really want to use this as there is no guarantee it is supported by all browsers.
It is also considered obsolete:
https://www.w3.org/TR/html5/obsolete.html#the-marquee-element-0
If you want this effect I recommend looking at this answer:
Very Simple, Very Smooth, JavaScript Marquee
The marquee tag was introduced by either Netscape or Microsoft, back then when there was a browser war between Netscape 4 and IE4. It could be part of HTML 3, but definitely not of the HTML 4 Standard.
Nevertheless, current browsers just support it, since the code is already builtin for backwards compatibility.

Why <center> can still work in html 5?

<!DOCTYPE html> specifies the page as html 5. But, when I used <center>, it can still center the content. Why <center> can still work in html 5 as I read from http://www.w3schools.com/tags/ that <center> is supposed to not work?
The tag is obsolete since HTML4. But it is still supported in some browsers even now. MDN advices to not use it
Obsolete
This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it.
Use css text-align: center instead.
It's not part of the specs anymore but it's up to the browser whether or not they still support the tag. Most browsers will to make sure older code still works.
But, since it is deprecated you should not use it in new code. Go with CSS to get your stuff centered.
Browsers may still support it and at some point they will not. Take at look at this page to see if you can use or should use an html element, css property and more: http://caniuse.com/#search=center
Since HTML4, <center>, and other presentation tags (such as <blink>) has been deprecated from HTML specs, and removed in HTML5 specs.
Those tags should be replaced by other content tags (the most abstract one being <div>) in addition to CSS for the styling they did provide.
But since those tags don't lead to any security issue, (contrary to <frame>) they may still be supported by browsers for compatibility issues.
Even if today, google's main page still uses it, you should prefer to use an other content tag with proper CSS styling.

Is there a HTML and CSS validator which also checks for ie7 compatibility?

I just made a clean website using HTML4 and CSS. Which worked perfectly fine in Chrome and Firefox. I also checked my site using the W3C CSS validator and fixed all the errors and warnings that were displayed. However, when I checked on IE7. The site was totally misaligned and out of place.
Is there a HTML and CSS validator which also checks for ie7 compatibility?
No, because what you're asking for is not a "validator" but an "invalidator". IE7 has a number of bugs, and lacks implementation of a number of features. There's no way for an "invalidator" to know your intent with anything, and thus, can't tell what you are trying to do.
With your site being a clean html4 and css site, maybe I'm offbase and you've already done this, but just double check that you've included a doctype declaration tag at the beginning of each page. As mentioned above, IE renders in quirks mode without a DOCTYPE specified, and personally i've solved many problems by specifying a doctype in my sites.
The route leads along knowing important CSS concepts and browser characteristics. I think there is no such validation service or tool that points out the hacks necessary. :( But there are some magic bullets against bugs in IE7 (e.g. setting the flag hasLayout=true or position:relative). There is a good collection of bug descriptions and reduction here: http://www.brunildo.org/test/index.html.
I recommend you start using a CSS reset file. This will reset all default css. These default css settings are different for most browsers. If you do not override them manually, you give the browser the control on your layout. And that's not what we want, aren't we?
I suggest you to upgrade you html to some newer version (html5 if possible or) at least xhtml 1.1, I think the problem is that IE7 is working in "quirks mode".
More information about Quirks mode here

Shifting my website to html5 [duplicate]

This question already has answers here:
Is HTML5 backwards compatible with XHTML?
(3 answers)
Closed 9 years ago.
Currently I have my website coded in XHTML strict. Can it be converted to HTML5 only by changing doctypes? Or are there other changes I need to make?
A really useful tool for checking if your site is html5 compatible is the W3C Markup Validator. If you update the doctype to <!DOCTYPE html> and then run the html through the validator, it will show you all instances of where your html is not currently compatible with html5.
This will most likely include changing some self closing tags, some properties may have changed and if you truly want to be html5 up to date (rather than just compatible) you should consider using the <header>, <nav>, <section>, <article> tags, instead of just normal divs.
Updating may also make your page look different on non compatible browsers, in this case I recommend using html5shiv so that older versions of IE support the new tags that you're using.
You also have to change many tag elements if you want "true" HTML5 such as menu, section, footer...
Also it may require some changes in CSS as in HTML5 all elements have div's properties.
And you'll need to use some scripts to support HTML5 in old IEs.
XHTML works fine in HTML5 and is nicknamed 'XHTML5' but, if you're not serving it as application/xhtml+xml, then you're not getting any of those advantages. You shouldn't be using XHTML if you're not serving as such anyway. You're also not gaining anything by just changing the doctype unless you're going to rewrite the current page and add some new elements, use APIs, and all that.
If you are only going to do a step-by-step conversion over time, you can swap doctypes and you probably won't notice any difference. Run it through the validator to check for errors. Fix your errors before moving on.