Best practice when changing code in a HTML doc? |
Best practice when changing code in a HTML doc? |
ahnam |
Apr 7 2021, 04:47 AM
Post
#1
|
Group: Members Posts: 8 Joined: 7-April 21 Member No.: 27,885 |
During my studies I read that you can used the COMMEND to remove code from your HTML document. Today I found the DEL TAG what is used to change existing code. I was wondering what is the best practice when changing code in a HTML document. Do you used DEL TAG, removed the code make making it a COMMEND or do you PHYSICALLY REMOVE the code from the HTML document? I will be grateful is somebody can steer me in the right direction!
|
Christian J |
Apr 7 2021, 06:56 AM
Post
#2
|
. Group: WDG Moderators Posts: 9,656 Joined: 10-August 06 Member No.: 7 |
The DEL element doesn't remove anything. It's used to show site visitors that the content is no longer applicable. The content remains visible, but is normally styled with a strike-though line. See also https://www.htmlhelp.com/reference/html40/phrase/del.html
An HTML comment can be used to hide code from both visitors and the browser engine, but the code is still visible to anyone looking at the HTML source. This is practical for making temporary changes, or for the developer to add notes to himself in the code. See also https://htmlhelp.com/faq/html/all.html#html-comments You can remove code completely if you'll never need it again. But it's often a good idea to save at least a copy of the HTML document when making changes. |
pandy |
Apr 7 2021, 07:02 AM
Post
#3
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,730 Joined: 9-August 06 Member No.: 6 |
To permanently delete or to comment out part of the markup is partly a personal preference. Personally I may comment out either if I'm not sure I want to keep the change, to try things out so to speak. Or if I may want to use the same markup again later. Say I have different images at the top of my page depending on season. Then I may leave all of them in the markup but comment out all but the spring one now, so it's easy to make the change when summer comes and so on.
DEL is something else. It concerns changes to the content, not the markup, and it doesn't remove anything. Say you are working on a scientific paper and your peers want to be able to follow changes made to it. Then you can use DEL and style it in a way that is stands out and makes it obvious it's no longer part of the paper. It doesn't need to be something scientific, that was just an example. We tend to use strikeout here on the forum if we make a mistake and later correct it, so people who read the original post won't be confused. Like this. The whale is a large On a web page that could be done like this. CODE The whale is a large <del>fish</del> mammal. And the DEL would be styled, for example with 'text-decoration: line-through' and maybe a fainter color. Fact is, browsers tend to style DEL just with line-through by default. You can read more about DEL here. https://htmlhelp.com/reference/html40/phrase/del.html |
pandy |
Apr 7 2021, 07:05 AM
Post
#4
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,730 Joined: 9-August 06 Member No.: 6 |
Groan... There I get for typing slow.
|
ahnam |
Apr 7 2021, 08:06 AM
Post
#5
|
Group: Members Posts: 8 Joined: 7-April 21 Member No.: 27,885 |
One more - Thanks you very much Pandy and Christian J. Your feedback are much appreciated.
|
Lo-Fi Version | Time is now: 24th April 2024 - 01:50 PM |