Jump to content

Meta description new line

DriedSponge
Go to solution Solved by mariushm,

Not sure I understand the question.

You can use ENTER or newline characters in the content attribute and it should work just fine.

If you want to force it to stay on one line, you could use escape individual bytes with the &#number;  or &#xHEXCODE; format 

An enter is defined as CRLF = carriage return + line feed... 0x0D and 0x0A , \r and \n ... \n is typically enough.

 

So you could say

 

<meta name="description" content="First line,&#x0A; second line, third line" />

(funny, if you double click the code boxes to edit, the code auto converts the sequence to actual new line)

 

and if you open the development tools and type in console  document.head you will see in the object

 

firstElementChild: <meta name="description" content="First line,\n second line, third line">

so you can see the browser converted the html escape sequence to \n , the new line / line feed character

 

Hello there! Does anyone how to stat a new line in the meta decription ta?

Something like this:

<meta name="description" content="Fisrt line, second line, third line" />

 

Remember to quote or @mention others, so they are notified of your reply

AMD Ryzen 9 5950X | Arctic Liquid Freezer II 360 | MSI B450 TOMAHAWK MAX | G.Skill Trident Z RGB 32 GB DDR4-3600 | Gigabyte GeForce RTX 2080 SUPER 8 GB 

Samsung 980 EVO Plus 2TB | SK hynix Gold S31 500GB SSD | Seagate Barracuda Compute 2 TB 7200RPM HDD | 1TB Samsung 860 EVO SSD | 3x Phanteks T30-120

Corsair RM1000e 1000 W 80+ Gold Certified Modular PSU | Corsair 5000D Airflow Windows 11 Home

Link to comment
Share on other sites

Link to post
Share on other sites

Not sure I understand the question.

You can use ENTER or newline characters in the content attribute and it should work just fine.

If you want to force it to stay on one line, you could use escape individual bytes with the &#number;  or &#xHEXCODE; format 

An enter is defined as CRLF = carriage return + line feed... 0x0D and 0x0A , \r and \n ... \n is typically enough.

 

So you could say

 

<meta name="description" content="First line,&#x0A; second line, third line" />

(funny, if you double click the code boxes to edit, the code auto converts the sequence to actual new line)

 

and if you open the development tools and type in console  document.head you will see in the object

 

firstElementChild: <meta name="description" content="First line,\n second line, third line">

so you can see the browser converted the html escape sequence to \n , the new line / line feed character

 

Link to comment
Share on other sites

Link to post
Share on other sites

Alright that works for me! Thank you!

Remember to quote or @mention others, so they are notified of your reply

AMD Ryzen 9 5950X | Arctic Liquid Freezer II 360 | MSI B450 TOMAHAWK MAX | G.Skill Trident Z RGB 32 GB DDR4-3600 | Gigabyte GeForce RTX 2080 SUPER 8 GB 

Samsung 980 EVO Plus 2TB | SK hynix Gold S31 500GB SSD | Seagate Barracuda Compute 2 TB 7200RPM HDD | 1TB Samsung 860 EVO SSD | 3x Phanteks T30-120

Corsair RM1000e 1000 W 80+ Gold Certified Modular PSU | Corsair 5000D Airflow Windows 11 Home

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×