Should I use HTML entities in 2023? [closed] - html

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 3 days ago.
Improve this question
As the title says, my question is should I use HTML entities in 2023?
I already searched for answers on SO and found out a lot of opinions but most of them are 13-14 years old and the people say that even if you set the charset meta-tag to "utf-8", you still need the HTML entities for the special characters <, >, &, and ".
Is that still a valid statement in 2023? I tested these special characters in Chrome, Mozilla, Edge and Safari and they seem to work fine being hardcoded like that:
<p>
<, >, &, "
</p>
instead of using html entities.

Related

What Unicode character represents "Add User/Account" [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 3 years ago.
Improve this question
As the Title says, I want to have a button in HTML which should add users to my database. Alright, I have that. Now I want it to display a symbol representing this feature. I only want to use images as a last resort. So do you have any suggestions for my needs? Haven't found anything by simply asking Google.
To be specific, the character should have a silhouette of an upper body and a plus sign.
There are a couple of Unicode symbols which look like "user".
πŸ‘€
U+1F464 Bust in Silhouette
πŸ‘₯
U+1F465 Busts in Silhouette
You will need to test with users to see which they associate more with "Add User". You might need to use a couple of characters. For example
πŸ‘€βž•
πŸ†•πŸ‘€
Or, if your users are technologists, doctors, students etc you could use their emoji.
πŸ‘©β€πŸ’» πŸ‘©β€βš•οΈ πŸ‘©β€πŸŽ“
As of Unicode 12.1, there is no such symbol expressing this meaning.
Do use an image, e.g. https://material.io/resources/icons/static/icons/baseline-person_add-24px.svg

two space tab is the safest one? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
Bumped into such a statement:
Use soft tabs with two spacesβ€”they're the only way to guarantee code renders the same in any environment.
Is that true? (and why?)
No this is not true and everyone has an own best practice related to editor settings and code formatting.
I think that two spaces is just to few, because in long source codes with several nesting levels it is much easier for me to distinguish between different indentation levels if there are ate least four spaces used as tab width.

which character encoding should i choose for my website? and how do i decide it? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
why is it important to declare character encoding in an HTML page and how do I decide that which type of character encoding should I choose for my website?
I used to simply use UTF-8 for all html pages. But is there any specific reason why I should use it?
Yes, you should use UTF-8:
it supports everything (i.e. all languages and all symbols)
it is supported be everything (all programming languages, frameworks, databases, you name it)
it is the dominant encoding on the Web these days: http://googleblog.blogspot.ca/2012/02/unicode-over-60-percent-of-web.html
Any other encoding is asking for trouble.
You should specify encoding as UTF-8 because some pieces of software may default to ISO-8859-1 if not instructed not to.
This is important because of HTML page can contain different languages. UTF-8 is multilingual encoding. But if your pages do not contain non-english characters, encoding is not important because all code pages have these english characters on the same position.

Regular expression to replace <br style="..."> by <br style="..."/> [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I need a regular expression to help me close the <br> tag to comply with the xhtml standard. In my html br does not always comes empty, so the regex has to account for it. Thanks in advance for your help.
Look for this pattern
(\<br[^\>]*)(\/)?(\>)
And replace with this
$1/$3
Based on the engine you may need to use \1/\2 instead of $1/$3 in the replacement string.
The regex might also look a bit simpler:
replace
/<br.*?>/i
with
<br\/>

HTML Compressor | Line breaks needed? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I'm minifying my html using:
http://htmlcompressor.com/compressor.html
It leaves return characters in so instead of one single line...I get a bunch of individual lines.
Any reason why?(JS and CSS minifiers do not do this) Any experience with this for html minification? Is this a solid tool?
Newlines can affect the output, so they can't really be safely stripped from every HTML document.
For example:
​<p>
Hello
World
</p>
<p>HelloWorld</p>​
This gets rendered as:
Hello World
HelloWorld
Demo: http://jsfiddle.net/UTy2f/