Disadvantages of using consistent-behaving yet deprecated HTML tags?

前端 未结 6 1970
庸人自扰
庸人自扰 2021-01-19 03:52

When users visit my website, they don\'t care about how perfect or how much standard the page is coded. They only care about whether it works or not.

相关标签:
6条回答
  • 2021-01-19 04:11

    The disadvantage is when one of the major browsers chooses to get rid of the deprecated tag in a future release.

    0 讨论(0)
  • 2021-01-19 04:18

    I've added some more disadvantages:

    1. Another disadvantage of using those tags is site bandwidth. When you put in html center, bgcolor and similar tags every time browser needs to load the whole content even if on every page those tags are the same or even if user visited this site many times. But when you place design in css file browsers may cache those files (especially when you set headers properly) so they only load html and images (if no cache is set).

    2. One another thing is that if you decide to redesign the site/style new elements, it's much easier to put changes only in CSS files. It's possible in future you won't be doing those changes on your own or other companies/freelancers will be doing them and it will be much easier for them to make changes in the site. So the site will be cheaper to maintain.

    3. In addition if html / php code is poor (or site is very complex) and many "visual conditions" appear in many files (for example on one page you decide to use one colour and you put it in HTML, on the other another colour) and something goes wrong it will be much easier to find the problem because you may simple cut some css and check where's the problem.

    0 讨论(0)
  • 2021-01-19 04:19

    The advantage of using CSS over tags is that you can change the whole web site look and feel in a simple move.

    Consider people that require larger font sizes. Colour blindness and also enable the most use of screen readers.

    0 讨论(0)
  • 2021-01-19 04:22

    Potential disadvantages include the following:

    1) Your customer might actually care about how standard the code is. Maybe not now, but in the future. Maybe for questionable reasons, but still.

    2) Deprecated constructs do not always work consistently. For example, align=center attribute set on a table may have different effects depending on browser mode. This is a relatively weak argument, though, since the browser practices have been described rather well in HTML5 CR and you can manage the potential problems. (Besides, even CSS settings may work inconsistently.)

    3) There is no guarantee that deprecated features will be supported by all future browsers. On the other hand, the same applies to standard features. In practice, very few features that have been defined in HTML specifications have actually been removed from browsers. (Regarding tags, I think basefont is the only case.) All the examples mentioned, and also marquee, have been described in HTML5 CR as “obsolete” but still well-defined, and according to HTML5 CR, browsers are expected, and partly required, to support them all.

    4) Your colleagues (designers/developers/...) may regard your code (and you) as old-fashioned, non-semantic, and whatever.

    5) Code maintenance and development may be more difficult. If you have 1,000 pages with <body bgcolor=black> and the customer says they want a somewhat different background color, you would need to edit each page. This argument is, however, weaker than it seems to be. First, how often do such things actually happen? Second, if the pages have actually been generated using suitable tools, perhaps you just need to change the value of one parameter and regenerate them (or just let servers do that, if the pages are dynamically generated). Third, if you have a link element on all pages, referring to basic style sheet for the pages, as you normally should, you just need to add one rule to that style sheet. It is easy to override presentational HTML attributes with CSS.

    To summarize, the practical arguments against your approach are rather weak. The most important arguments relate to coding style and principles.

    0 讨论(0)
  • 2021-01-19 04:23

    CSS provides easier maintenance, for one; client decides they want some elements aligned left instead of center? Change your css rule and poof, you're done. But if you're using old-school valign and such? Get ready to go change every single instance of that in the file(s).

    0 讨论(0)
  • 2021-01-19 04:31

    Even those consistent behaviour tags may be removed from browser. What if you would like to create HTML5 website? Then you will need to learn everything from scratch and change literally everything for your website to make it work because you never know if those tags will be supported in HTML 5 in future or only in older HTML documents

    0 讨论(0)
提交回复
热议问题