Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

html: how to start with a space in title

Tags:

html

It seems the starting &nbsp was ignored in the title tag.

Demo below:

 <title>&nbsp;&nbsp;&nbsp;pika</title>

I wondered is there a way to hack this, maybe using a foreign character which looks like a space? Any advice?

like image 712
Junjie Zhang Avatar asked Jan 19 '16 11:01

Junjie Zhang


People also ask

How do I add spaces to my HTML code?

Open your HTML code. Another way to add more spaces to your code is to use the HTML <pre> tag. This tag essentially displays the text exactly as you type or paste it, spaces and all. Start by opening your code in a text editor like Notepad for Windows or TextEdit for macOS. Type <pre> </pre> tags in the body of your document.

What does 5 spaces mean in HTML?

It instructs the browser that the text is to appear exactly as written in the HTML file, including any spaces or blank lines. If you type five spaces inside <pre> tags, you get five spaces on the website.character. The &nbsp; character creates a space that does not break into a new line.

How to add space around a paragraph break in HTML?

1 The <p> tag creates a paragraph break. 2 The <br> tag indicates a line break. 3 The <pre> tag is used with a preformatted text. ... 4 The character creates non-breaking space. 5 The and &Tab; characters create tab spaces in HTML. ... 6 You can also add space around a text with CSS.

Which characters create tab spaces in HTML?

It instructs the browser that the text should appear exactly as it is in the HTML file, including blank lines and spaces. The   character creates non-breaking space. The and &Tab; characters create tab spaces in HTML.


1 Answers

There are potential reasons for doing this. Especially if search engines isn't a consideration. In a web app, you may want to dynamically change the title for effect, for example.

In the situation I had, we wanted to flash an emoji if you moved to another tab and activity occurred on the hidden tab. Were only using Chrome and this worked for us. Getting the spacing right is still a trick.

The character &#6158; is called a Mongolian space and is not strictly considered a space character for classification purposes. I found that if you lead with this, you can put whatever you want after, for example:

<title>&#6158;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Title</title>
like image 135
Mark Swardstrom Avatar answered Oct 16 '22 02:10

Mark Swardstrom