The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

> CSS advantage over deprecated in-line tags ?
Holmwood
post Dec 5 2023, 03:32 PM
Post #1





Group: Members
Posts: 1
Joined: 5-December 23
Member No.: 29,095



First post here and just a general point as much as a query. I have a couple of small hobby websites and have not used CSS, but have been looking into it. Not sure I really see the point except that O'Reilly's HTML The Definitive Guide warns that numerous simple old-style tags are likely to be discontinued some time soon (and my edition is 20 years old*), like u for underline and even font.

I can see the point of CSS for Megacorps websites where they want a common corporate style and provide a common .css file for everyone to use. That's fine, but is there a good reason to deprecate and maybe discontinue the older simpler method? The Guide has an undertone that they wish deliberately to make it more tiresome to change font and colour etc, to discourage people from making their websites look like ransom notes. But is that a big problem these days?

For example I want to make a single character in a text a different colour. Every example I found on the web of using CSS to change colour involved an entire block of text that already had some tag, such as a paragraph, division, heading, or the whole document. I did eventually discover the SPAN tag, so in my application I could do either with the old deprecated font tag :-

CODE

<BODY>
The dial has black numbers for the shutter speeds, but the flash sync speed is shown with a red <font color=red>X</font>, which is 1/60th of a second.
[etc etc]
</BODY>

Or I could use the significantly longer CSS approach, first defining the style attribute in the document head :-

CODE

<HEAD>
<style type="text/css">
<!--
SPAN.redfont {color: red}
-->
</style>
[etc etc]
</HEAD>

<BODY>
The dial has black numbers for the shutter speeds, but the flash sync speed is shown with a red <span class=redfont>X</span>, which is 1/60th of a second.
[etc etc]
</BODY>

I have abbreviated this code of course.
Am I missing something?

* 3rd edition, not the latest.

This post has been edited by Holmwood: Dec 5 2023, 03:36 PM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
 
Reply to this topicStart new topic
Replies
Jason Knight
post Dec 8 2023, 12:25 AM
Post #2


Advanced Member
****

Group: Members
Posts: 109
Joined: 25-December 22
Member No.: 28,719



And seropiously, given that book is at least three versions behind on both HTML and CSS, decades behind on best practices, and is teaching you an HTML nobody should even be using any time after 2003-ish?

Light it on fire. Go here:
https://developer.mozilla.org/en-US/docs/Web/Tutorials

I mean Christmas on a cracker it has you writing HTML in uppercase and probably without DOCTYPE or character set declarations.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Posts in this topic


Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 17th May 2024 - 10:09 AM