Sorangwala Abbasali Sorangwala Abbasali - 2 months ago 6
HTML Question

::befor & ::after appearance in inspector window

I noticed recently that something is related to CSS3 and some DOM elements that kind of make ::before and ::after appear in the inspector window. I wonder why they appear there?

The sample is as follows:

Inspector snippet that shows befor-after appearance

Answer

Get a Local Copy of Bootstrap

If you can't access Bootstrap from the CDN, you'll need to pull it in via NuGet or your preferred package manager (npm, bower, etc.). This will download the files into your solution so that they don't require any external connections.

Additionally, you can download Bootstrap directly if you would prefer that approach.

Reference the Local File

Once you have it in your solution, you'll just need to reference it by location within the <head> section of your _Layout.cshtml file:

<!-- Point to the location within your solution that Bootstrap is stored -->
<link href="~/Content/bootstrap.min.css" rel="stylesheet" type="text/css" />

Or you can simply drag-drop it from your Solution Explorer :

enter image description here

If you are still encountering issues, consider checking the Developer Tools (F12) within your browser and clearing your cache to ensure the latest files are being pulled properly.